diff options
author | Lennart Poettering <lennart@poettering.net> | 2019-04-10 19:39:12 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2019-04-10 20:03:38 +0200 |
commit | 7f000106012f2e641b5fd0604f6668e61a0f44c7 (patch) | |
tree | 60df2602db0db512282361c03135db18bc82204d /src | |
parent | 916a9ec7c6ad0e58a44457f9ea832f16350f5b74 (diff) | |
download | systemd-7f000106012f2e641b5fd0604f6668e61a0f44c7.tar.gz |
errno-util: rework ERRNO_IS_RESOURCE() from macro into static inline function
No technical reason, except that later on we want to add a new
ERRNO_IS() which uses the parameter twice and where we want to avoid
double evaluation, and where we'd like to keep things in the same style.
Diffstat (limited to 'src')
-rw-r--r-- | src/basic/errno-util.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/basic/errno-util.h b/src/basic/errno-util.h index f2677c7c19..ebb204128e 100644 --- a/src/basic/errno-util.h +++ b/src/basic/errno-util.h @@ -51,5 +51,9 @@ static inline bool ERRNO_IS_DISCONNECT(int r) { } /* Resource exhaustion, could be our fault or general system trouble */ -#define ERRNO_IS_RESOURCE(r) \ - IN_SET(abs(r), ENOMEM, EMFILE, ENFILE) +static inline bool ERRNO_IS_RESOURCE(int r) { + return IN_SET(abs(r), + EMFILE, + ENFILE, + ENOMEM); +} |