[systemd-commits] 2 commits - src/systemctl src/udev

Thomas H.P. Andersen phomes at kemper.freedesktop.org
Fri May 16 23:42:49 PDT 2014


 src/systemctl/systemctl.c |    8 ++++----
 src/udev/udevd.c          |    4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit bf9bead187802a52a1f376a03caee762d663e945
Author: Thomas Hindoe Paaboel Andersen <phomes at gmail.com>
Date:   Fri May 16 23:46:48 2014 +0200

    udev: avoid use of uninitialized err
    
    After 1ea972174baba40dbc80c51cbfc4edc49764b59b err is no longer
    set unless we hit a special case. Initialize it to 0 and remove
    a check that will never fail.

diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index bc0696c..1c9488e 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -267,7 +267,7 @@ static void worker_new(struct event *event)
                         struct udev_event *udev_event;
                         struct worker_message msg;
                         int fd_lock = -1;
-                        int err;
+                        int err = 0;
 
                         log_debug("seq %llu running", udev_device_get_seqnum(dev));
                         udev_event = udev_event_new(dev);
@@ -312,7 +312,7 @@ static void worker_new(struct event *event)
                         udev_event_execute_run(udev_event, &sigmask_orig);
 
                         /* apply/restore inotify watch */
-                        if (err == 0 && udev_event->inotify_watch) {
+                        if (udev_event->inotify_watch) {
                                 udev_watch_begin(udev, dev);
                                 udev_device_update_db(dev);
                         }

commit 4723e4b2a4ca7a7df449ab2377770301cce6abf7
Author: Thomas Hindoe Paaboel Andersen <phomes at gmail.com>
Date:   Fri May 16 23:37:54 2014 +0200

    systemctl: more cleanup
    
    This is followup on 05cae7f3431446236139434ee58a6275f3cb31e8
    
    I think the intention was to use the newly introduced 'path'
    variable in the inner loop instead of p.

diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 2fa8ecc..6e98c05 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -5030,16 +5030,16 @@ static int enable_sysv_units(const char *verb, char **args) {
                         _cleanup_free_ char *path = NULL;
 
                         if (!isempty(arg_root))
-                                asprintf(&p, "%s/%s/%s", arg_root, *k, name);
+                                asprintf(&path, "%s/%s/%s", arg_root, *k, name);
                         else
-                                asprintf(&p, "%s/%s", *k, name);
+                                asprintf(&path, "%s/%s", *k, name);
 
-                        if (!p) {
+                        if (!path) {
                                 r = log_oom();
                                 goto finish;
                         }
 
-                        found_native = access(p, F_OK) >= 0;
+                        found_native = access(path, F_OK) >= 0;
                         if (found_native)
                                 break;
                 }



More information about the systemd-commits mailing list