summaryrefslogtreecommitdiffstats
path: root/src/coredump/coredump-vacuum.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-03-03 05:07:10 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-03-04 23:10:13 +0100
commitf5fbe71d956957ca7ceb6777aed05a416fc83a43 (patch)
tree67358d417604030867a979f216bbb79939a37844 /src/coredump/coredump-vacuum.c
parenttable: drop last SIZE_MAX from table_set_sort() and table_set_display() (diff)
downloadsystemd-f5fbe71d956957ca7ceb6777aed05a416fc83a43.tar.xz
systemd-f5fbe71d956957ca7ceb6777aed05a416fc83a43.zip
tree-wide: use UINT64_MAX or friends
Diffstat (limited to 'src/coredump/coredump-vacuum.c')
-rw-r--r--src/coredump/coredump-vacuum.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/coredump/coredump-vacuum.c b/src/coredump/coredump-vacuum.c
index d20df847e8..95c3fca661 100644
--- a/src/coredump/coredump-vacuum.c
+++ b/src/coredump/coredump-vacuum.c
@@ -66,7 +66,7 @@ static int uid_from_file_name(const char *filename, uid_t *uid) {
}
static bool vacuum_necessary(int fd, uint64_t sum, uint64_t keep_free, uint64_t max_use) {
- uint64_t fs_size = 0, fs_free = (uint64_t) -1;
+ uint64_t fs_size = 0, fs_free = UINT64_MAX;
struct statvfs sv;
assert(fd >= 0);
@@ -76,7 +76,7 @@ static bool vacuum_necessary(int fd, uint64_t sum, uint64_t keep_free, uint64_t
fs_free = sv.f_frsize * sv.f_bfree;
}
- if (max_use == (uint64_t) -1) {
+ if (max_use == UINT64_MAX) {
if (fs_size > 0) {
max_use = PAGE_ALIGN(fs_size / 10); /* 10% */
@@ -94,7 +94,7 @@ static bool vacuum_necessary(int fd, uint64_t sum, uint64_t keep_free, uint64_t
if (max_use > 0 && sum > max_use)
return true;
- if (keep_free == (uint64_t) -1) {
+ if (keep_free == UINT64_MAX) {
if (fs_size > 0) {
keep_free = PAGE_ALIGN((fs_size * 3) / 20); /* 15% */