]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
llvm-analyze: change a few things to make llvm-analyze show fewer false positives
authorLennart Poettering <lennart@poettering.net>
Fri, 23 Sep 2011 00:39:54 +0000 (02:39 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 23 Sep 2011 14:28:27 +0000 (16:28 +0200)
src/logind.c
src/sysfs-show.c
src/systemctl.c
src/umount.c

index 1aad48d2dc0b4abca22053858388307796c41f1c..4633a5ef29109c9cf51538dfdc99deb5de96a4fb 100644 (file)
@@ -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;
index ab866a470755235aaaec899e1c5e433453fbdff6..b8b356d77b1945ddcb4adf57340e45384d66ff77 100644 (file)
@@ -165,6 +165,9 @@ int show_sysfs(const char *seat, const char *prefix, unsigned n_columns) {
         else
                 r = udev_enumerate_add_match_tag(e, "seat");
 
+        if (r < 0)
+                goto finish;
+
         r = udev_enumerate_scan_devices(e);
         if (r < 0)
                 goto finish;
index fdff2d12506ba9aaa4e7daaa12b91125576f91b3..2bf2b697e2f91702f6000ac87dfd7587663fc88f 100644 (file)
@@ -2154,8 +2154,6 @@ static void print_status_info(UnitStatusInfo *i) {
 
                 printf(")%s\n", off);
 
-                on = off = NULL;
-
                 if (i->main_pid == p->pid &&
                     i->start_timestamp == p->start_timestamp &&
                     i->exit_timestamp == p->start_timestamp)
index 67be42ea337397b57ec3f045f0a8425765a2a526..4e036d82a30555988c18fea2c4dc8a8333f4b78c 100644 (file)
@@ -565,10 +565,13 @@ int umount_all(bool *changed) {
         /* retry umount, until nothing can be umounted anymore */
         do {
                 umount_changed = false;
-                r = mount_points_list_umount(&mp_list_head, &umount_changed, false);
+
+                mount_points_list_umount(&mp_list_head, &umount_changed, false);
                 if (umount_changed)
                         *changed = true;
-        } while(umount_changed);
+
+        } while (umount_changed);
+
         /* umount one more time with logging enabled */
         r = mount_points_list_umount(&mp_list_head, &umount_changed, true);
         if (r <= 0)