return t;
}
-bool ignore_file(const char *filename) {
+static bool ignore_file_allow_backup(const char *filename) {
assert(filename);
return
streq(filename, "lost+found") ||
streq(filename, "aquota.user") ||
streq(filename, "aquota.group") ||
- endswith(filename, "~") ||
endswith(filename, ".rpmnew") ||
endswith(filename, ".rpmsave") ||
endswith(filename, ".rpmorig") ||
endswith(filename, ".swp");
}
+bool ignore_file(const char *filename) {
+ assert(filename);
+
+ if (endswith(filename, "~"))
+ return false;
+
+ return ignore_file_allow_backup(filename);
+}
+
int fd_nonblock(int fd, bool nonblock) {
int flags;
bool dirent_is_file_with_suffix(const struct dirent *de, const char *suffix) {
assert(de);
- if (!dirent_is_file(de))
+ if (de->d_type != DT_REG &&
+ de->d_type != DT_LNK &&
+ de->d_type != DT_UNKNOWN)
+ return false;
+
+ if (ignore_file_allow_backup(de->d_name))
return false;
return endswith(de->d_name, suffix);