mirror of
https://github.com/AuxXxilium/eudev.git
synced 2024-12-28 06:35:34 +07:00
journald: fix calculation of disk space
This commit is contained in:
parent
15944db871
commit
a3a52c0fd0
@ -2068,7 +2068,7 @@ int journal_directory_vacuum(const char *directory, uint64_t max_use, uint64_t m
|
||||
}
|
||||
|
||||
list[n_list].filename = p;
|
||||
list[n_list].usage = (uint64_t) st.st_blksize * (uint64_t) st.st_blocks;
|
||||
list[n_list].usage = 512UL * (uint64_t) st.st_blocks;
|
||||
list[n_list].seqnum = seqnum;
|
||||
list[n_list].realtime = realtime;
|
||||
list[n_list].seqnum_id = seqnum_id;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user