chiark / gitweb /
remove non-login things from man
[elogind.git] / src / shared / util.h
index 014e61c2e6f5807cb783a565b63a0a8f66edd056..3aef47f37d36accaa38ed8e883fe514e62afc8ca 100644 (file)
@@ -775,7 +775,7 @@ int shall_restore_state(void);
  * that only if nmemb > 0.
  */
 static inline void qsort_safe(void *base, size_t nmemb, size_t size, comparison_fn_t compar) {
-        if (nmemb <= 0)
+        if (nmemb <= 1)
                 return;
 
         assert(base);
@@ -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);