From ad0a762293c307fa9a4bb71afe63168496a4dbb8 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 21 May 2015 19:48:49 +0200 Subject: [PATCH] util: introduce PERSONALITY_INVALID as macro for 0xffffffffLU --- src/shared/util.c | 5 +---- src/shared/util.h | 7 +++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/shared/util.c b/src/shared/util.c index 62c1739c9..d17359abd 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -4817,10 +4817,7 @@ unsigned long personality_from_string(const char *p) { return PER_LINUX; #endif - /* personality(7) documents that 0xffffffffUL is used for - * querying the current personality, hence let's use that here - * as error indicator. */ - return 0xffffffffUL; + return PERSONALITY_INVALID; } const char* personality_to_string(unsigned long p) { diff --git a/src/shared/util.h b/src/shared/util.h index 014e61c2e..abb36dfef 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -816,6 +816,13 @@ int open_tmpfile(const char *path, int flags); int fd_warn_permissions(const char *path, int fd); +#ifndef PERSONALITY_INVALID +/* personality(7) documents that 0xffffffffUL is used for querying the + * current personality, hence let's use that here as error + * indicator. */ +#define PERSONALITY_INVALID 0xffffffffLU +#endif + unsigned long personality_from_string(const char *p); const char *personality_to_string(unsigned long); -- 2.30.2