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:
parent
916a9ec7c6
commit
7f00010601
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue