errno-util: add new ERRNO_IS_DISK_SPACE() helper

This commit is contained in:
Lennart Poettering 2019-07-15 13:32:03 +02:00
parent b64cea6027
commit 9933a47808
1 changed files with 8 additions and 0 deletions

View File

@ -101,3 +101,11 @@ static inline bool ERRNO_IS_PRIVILEGE(int r) {
EACCES,
EPERM);
}
/* Three difference errors for "not enough disk space" */
static inline bool ERRNO_IS_DISK_SPACE(int r) {
return IN_SET(abs(r),
ENOSPC,
EDQUOT,
EFBIG);
}