diff --git a/AUTHORS b/AUTHORS index 987736a68..7f809519d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -98,4 +98,4 @@ suggestions: Andreas Kalex Adam Wolk Wim Schuermann - + Tom Duffy diff --git a/ChangeLog b/ChangeLog index a17e6bf22..9d101fae4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -83,6 +83,8 @@ certain circumstances (thanks to Steve Rader). + Fixed bug #645 & #660, which prevented logically combining report filters (thanks to Bryce Harrington). + + Fixed bug #691, which was a mis-reporting of file lock state even when file + locking was turned off (thanks to Tom Duffy). + Fixed bug #696, where the command line parser was confused by a single '-' or '+' character. + Fixed bug #699, truncated ssh://... during autopush after merge. diff --git a/src/TDB.cpp b/src/TDB.cpp index 019811da5..9c2ea298a 100644 --- a/src/TDB.cpp +++ b/src/TDB.cpp @@ -1597,8 +1597,9 @@ FILE* TDB::openAndLock (const std::string& file) throw std::string ("Could not open '") + file + "'."; // Lock if desired. Try three times before failing. - int retry = 0; if (mLock) + { + int retry = 0; while (flock (fileno (in), LOCK_NB | LOCK_EX) && ++retry <= 3) { std::cout << "Waiting for file lock...\n"; @@ -1606,8 +1607,9 @@ FILE* TDB::openAndLock (const std::string& file) delay (0.2); } - if (retry > 3) - throw std::string ("Could not lock '") + file + "'."; + if (retry > 3) + throw std::string ("Could not lock '") + file + "'."; + } return in; } diff --git a/src/TDB2.cpp b/src/TDB2.cpp index 064c36bbb..80e751c99 100644 --- a/src/TDB2.cpp +++ b/src/TDB2.cpp @@ -442,7 +442,6 @@ void TDB::lock (bool lockFile /* = true */) mCompleted.clear (); mModified.clear (); - foreach (location, mLocations) { location->pending = openAndLock (location->path + "/pending.data"); @@ -1836,8 +1835,9 @@ FILE* TDB::openAndLock (const std::string& file) throw std::string ("Could not open '") + file + "'."; // Lock if desired. Try three times before failing. - int retry = 0; if (mLock) + { + int retry = 0; while (flock (fileno (in), LOCK_NB | LOCK_EX) && ++retry <= 3) { std::cout << "Waiting for file lock...\n"; @@ -1845,8 +1845,9 @@ FILE* TDB::openAndLock (const std::string& file) delay (0.2); } - if (retry > 3) - throw std::string ("Could not lock '") + file + "'."; + if (retry > 3) + throw std::string ("Could not lock '") + file + "'."; + } return in; }