Remove some dead code

Based on coverity report.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2013-03-30 01:38:36 -04:00
parent a7edaadd78
commit 4dd1de72e8
6 changed files with 7 additions and 22 deletions

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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();

View File

@ -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")) {

View File

@ -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);