summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2014-12-24 13:02:36 +0000
committerChris Wilson <chris+github@qwirx.com>2014-12-24 13:02:36 +0000
commit3061624adf3606503545a57d560a5dd2863855bb (patch)
tree23166deff3d3b2048ae2467c0c3b062bb7990ead /bin
parent7801c51b005c5ed2f4ab8e0223669919af212bd2 (diff)
Don't add files to lists until we're sure that we'll back them up.
Diffstat (limited to 'bin')
-rw-r--r--bin/bbackupd/BackupClientDirectoryRecord.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/bin/bbackupd/BackupClientDirectoryRecord.cpp b/bin/bbackupd/BackupClientDirectoryRecord.cpp
index 4b053791..64716a8b 100644
--- a/bin/bbackupd/BackupClientDirectoryRecord.cpp
+++ b/bin/bbackupd/BackupClientDirectoryRecord.cpp
@@ -525,9 +525,6 @@ bool BackupClientDirectoryRecord::SyncDirectoryEntry(
// Next item!
return false;
}
-
- // Store on list
- rFiles.push_back(entry_name);
}
else if(type == S_IFDIR)
{
@@ -553,9 +550,6 @@ bool BackupClientDirectoryRecord::SyncDirectoryEntry(
return false;
}
#endif
-
- // Store on list
- rDirs.push_back(entry_name);
}
else // not a file or directory, what is it?
{
@@ -640,6 +634,16 @@ bool BackupClientDirectoryRecord::SyncDirectoryEntry(
}
}
+ // We've decided to back it up, so add to file or directory list.
+ if(type == S_IFREG || type == S_IFLNK)
+ {
+ rFiles.push_back(entry_name);
+ }
+ else if(type == S_IFDIR)
+ {
+ rDirs.push_back(entry_name);
+ }
+
return true;
}