summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-05-21 19:48:49 +0200
committerLennart Poettering <lennart@poettering.net>2015-05-21 19:48:49 +0200
commit050f727728f0631ce2b9c5f9635054480ccea3f6 (patch)
tree967efef2a54eb7b5e485f9401f38e7542f4edcfc /src/shared
parent481a0aa2c9803a62cda413b8a1d05571957bb4b5 (diff)
util: introduce PERSONALITY_INVALID as macro for 0xffffffffLU
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/util.c5
-rw-r--r--src/shared/util.h7
2 files changed, 8 insertions, 4 deletions
diff --git a/src/shared/util.c b/src/shared/util.c
index 5f5cfcb011..34024bacc4 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -4837,10 +4837,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 24a2672846..7f72d3a867 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);