X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flogin%2Flogind-user.c;h=49c373b50dad738c8f5ce5829d06c2c73d90ff80;hb=8dbce34b0373923c7aa7d795024bbedb0a85c7ea;hp=f865afdb53a3ddcb6be115aebd337e2d86171d90;hpb=f647962d64e844689f3e2acfce6102fc47e76df2;p=elogind.git diff --git a/src/login/logind-user.c b/src/login/logind-user.c index f865afdb5..49c373b50 100644 --- a/src/login/logind-user.c +++ b/src/login/logind-user.c @@ -56,7 +56,7 @@ User* user_new(Manager *m, uid_t uid, gid_t gid, const char *name) { if (asprintf(&u->state_file, "/run/systemd/users/"UID_FMT, uid) < 0) goto fail; - if (hashmap_put(m->users, ULONG_TO_PTR((unsigned long) uid), u) < 0) + if (hashmap_put(m->users, UID_TO_PTR(uid), u) < 0) goto fail; u->manager = m; @@ -97,7 +97,7 @@ void user_free(User *u) { free(u->runtime_path); - hashmap_remove(u->manager->users, ULONG_TO_PTR((unsigned long) u->uid)); + hashmap_remove(u->manager->users, UID_TO_PTR(u->uid)); free(u->name); free(u->state_file); @@ -511,7 +511,7 @@ static int user_remove_runtime_path(User *u) { log_error_errno(r, "Failed to remove runtime directory %s: %m", u->runtime_path); if (umount2(u->runtime_path, MNT_DETACH) < 0) - log_error("Failed to unmount user runtime directory %s: %m", u->runtime_path); + log_error_errno(errno, "Failed to unmount user runtime directory %s: %m", u->runtime_path); r = rm_rf(u->runtime_path, false, true, false); if (r < 0)