mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 08:42:13 +00:00
Bug 1418415 - Do more error checking. r=mccr8
While looking at this code I found a couple of places where errors could get ignored or silently discarded and result in corrupt data. This checks for the errors and fails harder. Depends on D10353 Differential Revision: https://phabricator.services.mozilla.com/D10354 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
160df1fcad
commit
86cb4f4e4d
@ -60,7 +60,9 @@ AutoLockFile::AutoLockFile(const std::string &Filename) {
|
||||
return;
|
||||
}
|
||||
|
||||
WaitForSingleObject(Handle, INFINITE);
|
||||
if (WaitForSingleObject(Handle, INFINITE) != WAIT_OBJECT_0) {
|
||||
return;
|
||||
}
|
||||
|
||||
FileDescriptor = _open(Filename.c_str(), _O_RDWR | _O_CREAT | _O_BINARY, 0666);
|
||||
}
|
||||
|
@ -479,7 +479,8 @@ public:
|
||||
AutoLockFile Lock(Filename);
|
||||
|
||||
if (!Lock.success()) {
|
||||
continue;
|
||||
fprintf(stderr, "Unable to lock file %s\n", Filename.c_str());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
std::vector<std::string> Lines;
|
||||
|
Loading…
Reference in New Issue
Block a user