diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-07-05 00:58:07 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-07-05 00:58:07 +0200 |
commit | a567261a29b4e19c0c195240411b7562063d99f8 (patch) | |
tree | af4c229fcb9b96520dad8941188c225c031bfb73 /src/systemctl.c | |
parent | 552e4331bf165290eb02596355d9570c1ef9af47 (diff) |
dbus: send signals about jobs to the clients having created them unconditionally, and thus get rid of broadcast signals in most cases
Diffstat (limited to 'src/systemctl.c')
-rw-r--r-- | src/systemctl.c | 37 |
1 files changed, 3 insertions, 34 deletions
diff --git a/src/systemctl.c b/src/systemctl.c index 226ecee3ad..1ad0c48a89 100644 --- a/src/systemctl.c +++ b/src/systemctl.c @@ -583,13 +583,10 @@ static DBusHandlerResult wait_filter(DBusConnection *connection, DBusMessage *me static int enable_wait_for_jobs(DBusConnection *bus) { DBusError error; - DBusMessage *m = NULL, *reply = NULL; - int r; assert(bus); dbus_error_init(&error); - dbus_bus_add_match(bus, "type='signal'," "sender='org.freedesktop.systemd1'," @@ -600,40 +597,12 @@ static int enable_wait_for_jobs(DBusConnection *bus) { if (dbus_error_is_set(&error)) { log_error("Failed to add match: %s", error.message); - r = -EIO; - goto finish; - } - - if (!(m = dbus_message_new_method_call( - "org.freedesktop.systemd1", - "/org/freedesktop/systemd1", - "org.freedesktop.systemd1.Manager", - "Subscribe"))) { - log_error("Could not allocate message."); - r = -ENOMEM; - goto finish; - } - - if (!(reply = dbus_connection_send_with_reply_and_block(bus, m, -1, &error))) { - log_error("Failed to issue method call: %s", error.message); - r = -EIO; - goto finish; + dbus_error_free(&error); + return -EIO; } - r = 0; - -finish: /* This is slightly dirty, since we don't undo the match registrations. */ - - if (m) - dbus_message_unref(m); - - if (reply) - dbus_message_unref(reply); - - dbus_error_free(&error); - - return r; + return 0; } static int wait_for_jobs(DBusConnection *bus, Set *s) { |