Bug #691
- Fixed bug #691, which was a mis-reporting of file lock state even when file locking was turned off (thanks to Tom Duffy).
This commit is contained in:
2
AUTHORS
2
AUTHORS
@@ -98,4 +98,4 @@ suggestions:
|
|||||||
Andreas Kalex
|
Andreas Kalex
|
||||||
Adam Wolk
|
Adam Wolk
|
||||||
Wim Schuermann
|
Wim Schuermann
|
||||||
|
Tom Duffy
|
||||||
|
|||||||
@@ -83,6 +83,8 @@
|
|||||||
certain circumstances (thanks to Steve Rader).
|
certain circumstances (thanks to Steve Rader).
|
||||||
+ Fixed bug #645 & #660, which prevented logically combining report filters
|
+ Fixed bug #645 & #660, which prevented logically combining report filters
|
||||||
(thanks to Bryce Harrington).
|
(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 '-'
|
+ Fixed bug #696, where the command line parser was confused by a single '-'
|
||||||
or '+' character.
|
or '+' character.
|
||||||
+ Fixed bug #699, truncated ssh://... during autopush after merge.
|
+ Fixed bug #699, truncated ssh://... during autopush after merge.
|
||||||
|
|||||||
@@ -1597,8 +1597,9 @@ FILE* TDB::openAndLock (const std::string& file)
|
|||||||
throw std::string ("Could not open '") + file + "'.";
|
throw std::string ("Could not open '") + file + "'.";
|
||||||
|
|
||||||
// Lock if desired. Try three times before failing.
|
// Lock if desired. Try three times before failing.
|
||||||
int retry = 0;
|
|
||||||
if (mLock)
|
if (mLock)
|
||||||
|
{
|
||||||
|
int retry = 0;
|
||||||
while (flock (fileno (in), LOCK_NB | LOCK_EX) && ++retry <= 3)
|
while (flock (fileno (in), LOCK_NB | LOCK_EX) && ++retry <= 3)
|
||||||
{
|
{
|
||||||
std::cout << "Waiting for file lock...\n";
|
std::cout << "Waiting for file lock...\n";
|
||||||
@@ -1608,6 +1609,7 @@ FILE* TDB::openAndLock (const std::string& file)
|
|||||||
|
|
||||||
if (retry > 3)
|
if (retry > 3)
|
||||||
throw std::string ("Could not lock '") + file + "'.";
|
throw std::string ("Could not lock '") + file + "'.";
|
||||||
|
}
|
||||||
|
|
||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -442,7 +442,6 @@ void TDB::lock (bool lockFile /* = true */)
|
|||||||
mCompleted.clear ();
|
mCompleted.clear ();
|
||||||
mModified.clear ();
|
mModified.clear ();
|
||||||
|
|
||||||
|
|
||||||
foreach (location, mLocations)
|
foreach (location, mLocations)
|
||||||
{
|
{
|
||||||
location->pending = openAndLock (location->path + "/pending.data");
|
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 + "'.";
|
throw std::string ("Could not open '") + file + "'.";
|
||||||
|
|
||||||
// Lock if desired. Try three times before failing.
|
// Lock if desired. Try three times before failing.
|
||||||
int retry = 0;
|
|
||||||
if (mLock)
|
if (mLock)
|
||||||
|
{
|
||||||
|
int retry = 0;
|
||||||
while (flock (fileno (in), LOCK_NB | LOCK_EX) && ++retry <= 3)
|
while (flock (fileno (in), LOCK_NB | LOCK_EX) && ++retry <= 3)
|
||||||
{
|
{
|
||||||
std::cout << "Waiting for file lock...\n";
|
std::cout << "Waiting for file lock...\n";
|
||||||
@@ -1847,6 +1847,7 @@ FILE* TDB::openAndLock (const std::string& file)
|
|||||||
|
|
||||||
if (retry > 3)
|
if (retry > 3)
|
||||||
throw std::string ("Could not lock '") + file + "'.";
|
throw std::string ("Could not lock '") + file + "'.";
|
||||||
|
}
|
||||||
|
|
||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user