diff options
author | David Herrmann <dh.herrmann@googlemail.com> | 2015-11-16 16:28:25 +0100 |
---|---|---|
committer | David Herrmann <dh.herrmann@googlemail.com> | 2015-11-16 16:28:25 +0100 |
commit | f7eb988333abd6bb661ab4c2607aeffb1b3832ce (patch) | |
tree | 9625779913464e0c2e101f566ac338415f7e6a90 /src/login/logind-core.c | |
parent | f5ed8d4a51b7f168eba9114a7cf4c2a3132cafff (diff) | |
parent | 2f157acdae14962ed7b7f7734f3e3547477aea0a (diff) |
Merge pull request #1918 from dvdhrm/user3
login: allow re-using users (v3)
Diffstat (limited to 'src/login/logind-core.c')
-rw-r--r-- | src/login/logind-core.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/login/logind-core.c b/src/login/logind-core.c index b3f30c8dc9..38c426c1aa 100644 --- a/src/login/logind-core.c +++ b/src/login/logind-core.c @@ -98,15 +98,16 @@ int manager_add_session(Manager *m, const char *id, Session **_session) { int manager_add_user(Manager *m, uid_t uid, gid_t gid, const char *name, User **_user) { User *u; + int r; assert(m); assert(name); u = hashmap_get(m->users, UID_TO_PTR(uid)); if (!u) { - u = user_new(m, uid, gid, name); - if (!u) - return -ENOMEM; + r = user_new(&u, m, uid, gid, name); + if (r < 0) + return r; } if (_user) |