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.
This commit is contained in:
Lennart Poettering 2019-04-10 19:39:12 +02:00
parent 916a9ec7c6
commit 7f00010601
1 changed files with 6 additions and 2 deletions

View File

@ -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);
}