chiark / gitweb /
Fix some format strings for enums, they are signed
[elogind.git] / src / shared / util.h
index 8a3e95a17aa11d55ed13e26e0d110264dde341c0..2d03ac8fd076a6854fc962e1f366a9d341a19bc5 100644 (file)
@@ -45,9 +45,9 @@
 #include <sys/inotify.h>
 
 #if SIZEOF_PID_T == 4
-#  define PID_FMT "%" PRIu32
+#  define PID_FMT "%" PRIi32
 #elif SIZEOF_PID_T == 2
-#  define PID_FMT "%" PRIu16
+#  define PID_FMT "%" PRIi16
 #else
 #  error Unknown pid_t size
 #endif
@@ -380,7 +380,7 @@ static inline uint32_t random_u32(void) {
                         if (!s)                                         \
                                 return log_oom();                       \
                 } else {                                                \
-                        r = asprintf(&s, "%u", i);                      \
+                        r = asprintf(&s, "%i", i);                      \
                         if (r < 0)                                      \
                                 return log_oom();                       \
                 }                                                       \
@@ -651,7 +651,10 @@ int setrlimit_closest(int resource, const struct rlimit *rlim);
 
 int getenv_for_pid(pid_t pid, const char *field, char **_value);
 
-bool is_valid_documentation_url(const char *url) _pure_;
+bool http_url_is_valid(const char *url) _pure_;
+bool documentation_url_is_valid(const char *url) _pure_;
+
+bool http_etag_is_valid(const char *etag);
 
 bool in_initrd(void);
 
@@ -1062,3 +1065,10 @@ void release_lock_file(LockFile *f);
 #define LOCK_FILE_INIT { .fd = -1, .path = NULL }
 
 #define RLIMIT_MAKE_CONST(lim) ((struct rlimit) { lim, lim })
+
+ssize_t sparse_write(int fd, const void *p, size_t sz, size_t run_length);
+
+void sigkill_wait(pid_t *pid);
+#define _cleanup_sigkill_wait_ _cleanup_(sigkill_wait)
+
+int syslog_parse_priority(const char **p, int *priority, bool with_facility);