chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cgroup-util: Don't send SIGCONT after SIGKILL
[elogind.git]
/
src
/
journal
/
coredump-vacuum.c
diff --git
a/src/journal/coredump-vacuum.c
b/src/journal/coredump-vacuum.c
index ad2e2fa7f4232bbdc4fe280ece3fb3a687c6fa25..9b73795e5bb27843a5bbef60c4febce84a0b6920 100644
(file)
--- a/
src/journal/coredump-vacuum.c
+++ b/
src/journal/coredump-vacuum.c
@@
-104,8
+104,8
@@
static bool vacuum_necessary(int fd, off_t sum, off_t keep_free, off_t max_use)
if (max_use < DEFAULT_MAX_USE_LOWER)
max_use = DEFAULT_MAX_USE_LOWER;
}
if (max_use < DEFAULT_MAX_USE_LOWER)
max_use = DEFAULT_MAX_USE_LOWER;
}
-
- max_use = DEFAULT_MAX_USE_LOWER;
+ else
+
max_use = DEFAULT_MAX_USE_LOWER;
} else
max_use = PAGE_ALIGN(max_use);
} else
max_use = PAGE_ALIGN(max_use);
@@
-139,10
+139,8
@@
int coredump_vacuum(int exclude_fd, off_t keep_free, off_t max_use) {
return 0;
if (exclude_fd >= 0) {
return 0;
if (exclude_fd >= 0) {
- if (fstat(exclude_fd, &exclude_st) < 0) {
- log_error("Failed to fstat(): %m");
- return -errno;
- }
+ if (fstat(exclude_fd, &exclude_st) < 0)
+ return log_error_errno(errno, "Failed to fstat(): %m");
}
/* This algorithm will keep deleting the oldest file of the
}
/* This algorithm will keep deleting the oldest file of the
@@
-156,7
+154,7
@@
int coredump_vacuum(int exclude_fd, off_t keep_free, off_t max_use) {
if (errno == ENOENT)
return 0;
if (errno == ENOENT)
return 0;
- log_error
(
"Can't open coredump directory: %m");
+ log_error
_errno(errno,
"Can't open coredump directory: %m");
return -errno;
}
return -errno;
}
@@
-194,7
+192,7
@@
int coredump_vacuum(int exclude_fd, off_t keep_free, off_t max_use) {
exclude_st.st_ino == st.st_ino)
continue;
exclude_st.st_ino == st.st_ino)
continue;
- r = hashmap_ensure_allocated(&h, NULL
, NULL
);
+ r = hashmap_ensure_allocated(&h, NULL);
if (r < 0)
return log_oom();
if (r < 0)
return log_oom();
@@
-258,7
+256,7
@@
int coredump_vacuum(int exclude_fd, off_t keep_free, off_t max_use) {
if (errno == ENOENT)
continue;
if (errno == ENOENT)
continue;
- log_error
(
"Failed to remove file %s: %m", worst->oldest_file);
+ log_error
_errno(errno,
"Failed to remove file %s: %m", worst->oldest_file);
return -errno;
} else
log_info("Removed old coredump %s.", worst->oldest_file);
return -errno;
} else
log_info("Removed old coredump %s.", worst->oldest_file);
@@
-267,6
+265,6
@@
int coredump_vacuum(int exclude_fd, off_t keep_free, off_t max_use) {
return 0;
fail:
return 0;
fail:
- log_error
(
"Failed to read directory: %m");
+ log_error
_errno(errno,
"Failed to read directory: %m");
return -errno;
}
return -errno;
}