diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-09-23 02:39:54 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-09-23 16:28:27 +0200 |
commit | 3e085b6c59257ca57534afc5044256f2102f9c28 (patch) | |
tree | cde9ec14fdd893c6fc00d8e70cabffb04a77cb27 /src/logind.c | |
parent | de3756ab9916551f3f4f1f360aee59aeed238b5b (diff) |
llvm-analyze: change a few things to make llvm-analyze show fewer false positives
Diffstat (limited to 'src/logind.c')
-rw-r--r-- | src/logind.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/logind.c b/src/logind.c index 1aad48d2dc..4633a5ef29 100644 --- a/src/logind.c +++ b/src/logind.c @@ -413,6 +413,7 @@ static int manager_enumerate_users_from_cgroup(Manager *m) { int r = 0; char *name; DIR *d; + int k; r = cg_enumerate_subgroups(SYSTEMD_CGROUP_CONTROLLER, m->cgroup_path, &d); if (r < 0) { @@ -423,9 +424,8 @@ static int manager_enumerate_users_from_cgroup(Manager *m) { return r; } - while ((r = cg_read_subgroup(d, &name)) > 0) { + while ((k = cg_read_subgroup(d, &name)) > 0) { User *user; - int k; k = manager_add_user_by_name(m, name, &user); if (k < 0) { @@ -446,6 +446,9 @@ static int manager_enumerate_users_from_cgroup(Manager *m) { free(name); } + if (r >= 0 && k < 0) + r = k; + closedir(d); return r; |