chiark / gitweb /
util: introduce PERSONALITY_INVALID as macro for 0xffffffffLU
authorLennart Poettering <lennart@poettering.net>
Thu, 21 May 2015 17:48:49 +0000 (19:48 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 08:57:27 +0000 (09:57 +0100)
src/shared/util.c
src/shared/util.h

index 62c1739c9326933456ee09619ad35bd1947ed777..d17359abd0a340fc81706a3777da1a12fb1f65bf 100644 (file)
@@ -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) {
index 014e61c2e6f5807cb783a565b63a0a8f66edd056..abb36dfef5e9dce159c2f271812167f4a9903e44 100644 (file)
@@ -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);