summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-01-20 22:22:15 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-01-22 01:14:52 -0500
commit1fa2f38f0f011010bf57522b42fcc168856a7003 (patch)
tree7bd1a23716379826ef6cd37f98c2f02470a2d5c4 /src/shared
parent8facc3498ed037f842891ff55d1f60fe834f4ba0 (diff)
Assorted format fixes
Types used for pids and uids in various interfaces are unpredictable. Too bad.
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/install-printf.c2
-rw-r--r--src/shared/log.c4
-rw-r--r--src/shared/sleep-config.c6
-rw-r--r--src/shared/util.h2
4 files changed, 7 insertions, 7 deletions
diff --git a/src/shared/install-printf.c b/src/shared/install-printf.c
index 1ee1243f4d..d853f17772 100644
--- a/src/shared/install-printf.c
+++ b/src/shared/install-printf.c
@@ -103,7 +103,7 @@ static int specifier_user_name(char specifier, void *data, void *userdata, char
if (r < 0)
return r;
- if (asprintf(&printed, "%d", uid) < 0)
+ if (asprintf(&printed, UID_FMT, uid) < 0)
return -ENOMEM;
break;
}}
diff --git a/src/shared/log.c b/src/shared/log.c
index f8c16de777..a870415a00 100644
--- a/src/shared/log.c
+++ b/src/shared/log.c
@@ -330,7 +330,7 @@ static int write_to_console(
highlight = LOG_PRI(level) <= LOG_ERR && show_color;
if (show_location) {
- snprintf(location, sizeof(location), "(%s:%u) ", file, line);
+ snprintf(location, sizeof(location), "(%s:%i) ", file, line);
char_array_0(location);
IOVEC_SET_STRING(iovec[n++], location);
}
@@ -1050,7 +1050,7 @@ void log_received_signal(int level, const struct signalfd_siginfo *si) {
get_process_comm(si->ssi_pid, &p);
log_full(level,
- "Received SIG%s from PID "PID_FMT" (%s).",
+ "Received SIG%s from PID %"PRIu32" (%s).",
signal_to_string(si->ssi_signo),
si->ssi_pid, strna(p));
} else
diff --git a/src/shared/sleep-config.c b/src/shared/sleep-config.c
index ae14c6bd4d..1064fd5cbd 100644
--- a/src/shared/sleep-config.c
+++ b/src/shared/sleep-config.c
@@ -167,7 +167,7 @@ int can_sleep_disk(char **types) {
static int hibernation_partition_size(size_t *size, size_t *used) {
_cleanup_fclose_ FILE *f;
- int i;
+ unsigned i;
assert(size);
assert(used);
@@ -190,8 +190,8 @@ static int hibernation_partition_size(size_t *size, size_t *used) {
k = fscanf(f,
"%ms " /* device/file */
"%ms " /* type of swap */
- "%zd " /* swap size */
- "%zd " /* used */
+ "%zu " /* swap size */
+ "%zu " /* used */
"%*i\n", /* priority */
&dev, &type, &size_field, &used_field);
if (k != 4) {
diff --git a/src/shared/util.h b/src/shared/util.h
index 2d03ac8fd0..179c9615f9 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -69,7 +69,7 @@
#endif
#if SIZEOF_TIME_T == 8
-# define PRI_TIME PRIu64
+# define PRI_TIME PRIi64
#elif SIZEOF_TIME_T == 4
# define PRI_TIME PRIu32
#else