diff options
author | 2009-06-04 17:01:06 -0700 | |
---|---|---|
committer | 2009-06-04 17:02:56 -0700 | |
commit | 173e38d47c0c1f2407fe2741700b8bdc3c6035cc (patch) | |
tree | 651c4afeda36110fc3e42006fd58626ae971e3e0 /libs/utils/BackupHelpers.cpp | |
parent | e9f4934470d09028bf3a92a2ed96c56d0a00662c (diff) |
Fix back_up_files() error detection when opening/CRCing the file
Diffstat (limited to 'libs/utils/BackupHelpers.cpp')
-rw-r--r-- | libs/utils/BackupHelpers.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/utils/BackupHelpers.cpp b/libs/utils/BackupHelpers.cpp index e8e6c45725..7f423a8e8e 100644 --- a/libs/utils/BackupHelpers.cpp +++ b/libs/utils/BackupHelpers.cpp @@ -350,10 +350,11 @@ back_up_files(int oldSnapshotFD, BackupDataWriter* dataStream, int newSnapshotFD FileState& g = newSnapshot.editValueAt(m); int fd = open(realFilename.string(), O_RDONLY); - if (fd != -1) { + if (fd < 0) { // We can't open the file. Don't report it as a delete either. Let the // server keep the old version. Maybe they'll be able to deal with it // on restore. + LOGP("Unable to open file %s - skipping", realFilename.string()); } else { g.crc32 = compute_crc32(fd); |