Assorted format fixes

Types used for pids and uids in various interfaces are unpredictable.
Too bad.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2015-01-22 01:14:52 -05:00
parent 8facc3498e
commit 1fa2f38f0f
37 changed files with 93 additions and 92 deletions
+1 -1
View File
@@ -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;
}}
+2 -2
View File
@@ -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
+3 -3
View File
@@ -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) {
+1 -1
View File
@@ -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