chiark / gitweb /
terminal: sysview: don't return uninitialized error codes
authorDavid Herrmann <dh.herrmann@gmail.com>
Thu, 28 Aug 2014 09:01:31 +0000 (11:01 +0200)
committerDavid Herrmann <dh.herrmann@gmail.com>
Thu, 28 Aug 2014 09:04:18 +0000 (11:04 +0200)
In case 'scan_evdev' and 'scan_drm' are both false, we never set 'r' to
anyhting, thus return an uninitialized error code. Fix this by always
returning 0 as we catch negative codes earlier, anyway. Thanks to Thomas
H.P. Anderson for the report.

src/libsystemd-terminal/sysview.c

index d885cb4d4aee722e2764df158bfc2560c1dfd4c1..f5363dedf403421f39bf1e46cc4f52d6f8d73c5d 100644 (file)
@@ -821,7 +821,7 @@ static int context_ud_prepare_monitor(sysview_context *c, struct udev_monitor *m
                         return r;
         }
 
-        return r;
+        return 0;
 }
 
 static int context_ud_prepare_scan(sysview_context *c, struct udev_enumerate *e) {