summaryrefslogtreecommitdiff
path: root/src/journal/journald.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-03-15 02:59:10 +0100
committerLennart Poettering <lennart@poettering.net>2012-03-15 03:01:09 +0100
commita3a52c0fd0c2597bf8233730c3ed3408affe0c9f (patch)
treeb6ec0d37e4fbf064b3430824aeed87d24cb14e5d /src/journal/journald.c
parent15944db87130f9b58565023c46c22bd73b0b71be (diff)
journald: fix calculation of disk space
Diffstat (limited to 'src/journal/journald.c')
-rw-r--r--src/journal/journald.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/journal/journald.c b/src/journal/journald.c
index fb298be758..ee270e79af 100644
--- a/src/journal/journald.c
+++ b/src/journal/journald.c
@@ -171,7 +171,10 @@ static uint64_t available_space(Server *s) {
if (fstatat(dirfd(d), de->d_name, &st, AT_SYMLINK_NOFOLLOW) < 0)
continue;
- sum += (uint64_t) st.st_blocks * (uint64_t) st.st_blksize;
+ if (!S_ISREG(st.st_mode))
+ continue;
+
+ sum += (uint64_t) st.st_blocks * 512UL;
}
avail = sum >= m->max_use ? 0 : m->max_use - sum;