diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bootchart/svg.c | 3 | ||||
-rw-r--r-- | src/core/dbus.c | 3 | ||||
-rw-r--r-- | src/libudev/libudev-util.c | 3 | ||||
-rw-r--r-- | src/shared/utmp-wtmp.c | 12 | ||||
-rw-r--r-- | src/timedate/timedated.c | 6 | ||||
-rw-r--r-- | src/udev/udevadm-trigger.c | 2 |
6 files changed, 7 insertions, 22 deletions
diff --git a/src/bootchart/svg.c b/src/bootchart/svg.c index cd896895c9..0fb9fffd9b 100644 --- a/src/bootchart/svg.c +++ b/src/bootchart/svg.c @@ -823,9 +823,6 @@ static void svg_ps_bars(void) { double starttime; int t; - if (!ps) - continue; - enc_name = xml_comment_encode(ps->name); if(!enc_name) continue; diff --git a/src/core/dbus.c b/src/core/dbus.c index 62cbf89f64..b92c7d0b99 100644 --- a/src/core/dbus.c +++ b/src/core/dbus.c @@ -978,9 +978,8 @@ static DBusConnection* manager_bus_connect_private(Manager *m, DBusBusType type) } return connection; + fail: - if (connection) - dbus_connection_close(connection); dbus_error_free(&error); return NULL; } diff --git a/src/libudev/libudev-util.c b/src/libudev/libudev-util.c index 44f6e4a863..714dc50ae9 100644 --- a/src/libudev/libudev-util.c +++ b/src/libudev/libudev-util.c @@ -241,8 +241,7 @@ int util_resolve_sys_link(struct udev *udev, char *syspath, size_t size) return -EINVAL; base[0] = '\0'; } - if (base == NULL) - return -EINVAL; + strscpyl(base, size - (base - syspath), "/", &link_target[back * 3], NULL); return 0; } diff --git a/src/shared/utmp-wtmp.c b/src/shared/utmp-wtmp.c index 0a0180979b..c9b986fc08 100644 --- a/src/shared/utmp-wtmp.c +++ b/src/shared/utmp-wtmp.c @@ -77,15 +77,11 @@ int utmp_get_runlevel(int *runlevel, int *previous) { a = found->ut_pid & 0xFF; b = (found->ut_pid >> 8) & 0xFF; - if (a < 0 || b < 0) - r = -EIO; - else { - *runlevel = a; + *runlevel = a; + if (previous) + *previous = b; - if (previous) - *previous = b; - r = 0; - } + r = 0; } endutxent(); diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c index 16fffd0844..1d4d73911e 100644 --- a/src/timedate/timedated.c +++ b/src/timedate/timedated.c @@ -367,8 +367,6 @@ static int read_ntp(DBusConnection *bus) { goto finish; } - if (reply) - dbus_message_unref(reply); reply = dbus_connection_send_with_reply_and_block(bus, m, -1, &error); if (!reply) { if (streq(error.name, "org.freedesktop.DBus.Error.FileNotFound")) { @@ -450,8 +448,6 @@ static int start_ntp(DBusConnection *bus, DBusError *error) { goto finish; } - if (reply) - dbus_message_unref(reply); reply = dbus_connection_send_with_reply_and_block(bus, m, -1, error); if (!reply) { if (streq(error->name, "org.freedesktop.DBus.Error.FileNotFound") || @@ -540,8 +536,6 @@ static int enable_ntp(DBusConnection *bus, DBusError *error) { } } - if (reply) - dbus_message_unref(reply); reply = dbus_connection_send_with_reply_and_block(bus, m, -1, error); if (!reply) { if (streq(error->name, "org.freedesktop.DBus.Error.FileNotFound")) { diff --git a/src/udev/udevadm-trigger.c b/src/udev/udevadm-trigger.c index 9624c66fba..f472996965 100644 --- a/src/udev/udevadm-trigger.c +++ b/src/udev/udevadm-trigger.c @@ -214,7 +214,7 @@ static int adm_trigger(struct udev *udev, int argc, char *argv[]) exec_list(udev_enumerate, action); goto exit; default: - goto exit; + assert_not_reached("device_type"); } exit: udev_enumerate_unref(udev_enumerate); |