summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-login/sd-login.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd/sd-login/sd-login.c')
-rw-r--r--src/libsystemd/sd-login/sd-login.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsystemd/sd-login/sd-login.c b/src/libsystemd/sd-login/sd-login.c
index 39445a191b..e7eea19580 100644
--- a/src/libsystemd/sd-login/sd-login.c
+++ b/src/libsystemd/sd-login/sd-login.c
@@ -172,7 +172,7 @@ _public_ int sd_uid_get_state(uid_t uid, char**state) {
assert_return(state, -EINVAL);
- if (asprintf(&p, "/run/systemd/users/%lu", (unsigned long) uid) < 0)
+ if (asprintf(&p, "/run/systemd/users/"UID_FMT, uid) < 0)
return -ENOMEM;
r = parse_env_file(p, NEWLINE, "STATE", &s, NULL);
@@ -215,7 +215,7 @@ _public_ int sd_uid_is_on_seat(uid_t uid, int require_active, const char *seat)
if (!s)
return -EIO;
- if (asprintf(&t, "%lu", (unsigned long) uid) < 0)
+ if (asprintf(&t, UID_FMT, uid) < 0)
return -ENOMEM;
FOREACH_WORD(w, l, s, state) {
@@ -231,7 +231,7 @@ static int uid_get_array(uid_t uid, const char *variable, char ***array) {
char **a;
int r;
- if (asprintf(&p, "/run/systemd/users/%lu", (unsigned long) uid) < 0)
+ if (asprintf(&p, "/run/systemd/users/"UID_FMT, uid) < 0)
return -ENOMEM;
r = parse_env_file(p, NEWLINE,