chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
72fbdd3
)
journalctl: really include .journal~ files in listing
author
Lennart Poettering
<lennart@poettering.net>
Tue, 21 Aug 2012 00:13:21 +0000
(
02:13
+0200)
committer
Lennart Poettering
<lennart@poettering.net>
Tue, 21 Aug 2012 00:13:21 +0000
(
02:13
+0200)
src/shared/util.c
patch
|
blob
|
history
diff --git
a/src/shared/util.c
b/src/shared/util.c
index 041b759287753044b787570f00c8b4e4b5579568..736cb15a5f9c22ad0f393bd63aa5838a9c1c147a 100644
(file)
--- a/
src/shared/util.c
+++ b/
src/shared/util.c
@@
-1800,7
+1800,7
@@
char *ascii_strlower(char *t) {
return t;
}
return t;
}
-
bool ignore_file
(const char *filename) {
+
static bool ignore_file_allow_backup
(const char *filename) {
assert(filename);
return
assert(filename);
return
@@
-1808,7
+1808,6
@@
bool ignore_file(const char *filename) {
streq(filename, "lost+found") ||
streq(filename, "aquota.user") ||
streq(filename, "aquota.group") ||
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, ".rpmnew") ||
endswith(filename, ".rpmsave") ||
endswith(filename, ".rpmorig") ||
@@
-1817,6
+1816,15
@@
bool ignore_file(const char *filename) {
endswith(filename, ".swp");
}
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;
int fd_nonblock(int fd, bool nonblock) {
int flags;
@@
-4262,7
+4270,12
@@
bool dirent_is_file(const struct dirent *de) {
bool dirent_is_file_with_suffix(const struct dirent *de, const char *suffix) {
assert(de);
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);
return false;
return endswith(de->d_name, suffix);