summaryrefslogtreecommitdiff
path: root/src/login/inhibit.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-09-19 20:57:42 +0300
committerLennart Poettering <lennart@poettering.net>2018-09-24 19:21:00 +0200
commit2f47ef04ea787ae397ba799dde6892b3e4bc9245 (patch)
tree2e4b0101c60933539baf33aa235ef969c45f24ef /src/login/inhibit.c
parent0e6872cdfcfefcee20f566bde25a89b74e55eef3 (diff)
downloadsystemd-2f47ef04ea787ae397ba799dde6892b3e4bc9245.tar.gz
inhibit: normalize variable types
When we parse an "u" from an sd_bus_message then we need to do that into a uint32_t, not a pid_t or uid_t, even if this is likely the same. Also, let's count objects we keep in memory as size_t as usual.
Diffstat (limited to 'src/login/inhibit.c')
-rw-r--r--src/login/inhibit.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/login/inhibit.c b/src/login/inhibit.c
index b19369aa76..e01aee6a5d 100644
--- a/src/login/inhibit.c
+++ b/src/login/inhibit.c
@@ -64,8 +64,8 @@ static int print_inhibitors(sd_bus *bus) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
_cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
const char *what, *who, *why, *mode;
- unsigned int uid, pid;
- unsigned n = 0;
+ uint32_t uid, pid;
+ size_t n = 0;
int r;
(void) pager_open(arg_no_pager, false);
@@ -95,7 +95,7 @@ static int print_inhibitors(sd_bus *bus) {
get_process_comm(pid, &comm);
u = uid_to_name(uid);
- printf(" Who: %s (UID "UID_FMT"/%s, PID "PID_FMT"/%s)\n"
+ printf(" Who: %s (UID %" PRIu32 "/%s, PID %" PRIu32"/%s)\n"
" What: %s\n"
" Why: %s\n"
" Mode: %s\n\n",
@@ -113,7 +113,7 @@ static int print_inhibitors(sd_bus *bus) {
if (r < 0)
return bus_log_parse_error(r);
- printf("%u inhibitors listed.\n", n);
+ printf("%zu inhibitors listed.\n", n);
return 0;
}