Assorted format fixes
Types used for pids and uids in various interfaces are unpredictable. Too bad.
This commit is contained in:
@@ -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
@@ -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
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user