chiark / gitweb /
systemctl: suppress error message when doing "systemctl daemon-reexec"
authorLennart Poettering <lennart@poettering.net>
Wed, 10 Jul 2013 18:44:21 +0000 (20:44 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 10 Jul 2013 21:41:03 +0000 (23:41 +0200)
When we issue a reexecution request via the private socket we need to
expect a "Disconnected" in addition to "NoReply" when the connection is
terminated.

src/shared/dbus-common.c
src/systemctl/systemctl.c

index f57956732136f3e65276c44f56079016f082bb40..c727cae7cd3c2fdb259dad9629d52e4a08803172 100644 (file)
@@ -1383,6 +1383,8 @@ int bus_method_call_with_reply(
                         r = -EACCES;
                 else if (dbus_error_has_name(&error, DBUS_ERROR_NO_REPLY))
                         r = -ETIMEDOUT;
+                else if (dbus_error_has_name(&error, DBUS_ERROR_DISCONNECTED))
+                        r = -ECONNRESET;
                 else
                         r = -EIO;
                 goto finish;
index e3818cd6df9ea809c503b95c7df92c629e5bc69f..d25b7d6fae90ecf93a7951257b44d278aa4ea4d8 100644 (file)
@@ -3938,9 +3938,9 @@ static int daemon_reload(DBusConnection *bus, char **args) {
                 /* There's always a fallback possible for
                  * legacy actions. */
                 r = -EADDRNOTAVAIL;
-        else if (r == -ETIMEDOUT && streq(method, "Reexecute"))
-                /* On reexecution, we expect a disconnect, not
-                 * reply */
+        else if ((r == -ETIMEDOUT || r == -ECONNRESET) && streq(method, "Reexecute"))
+                /* On reexecution, we expect a disconnect, not a
+                 * reply */
                 r = 0;
         else if (r < 0)
                 log_error("Failed to issue method call: %s", bus_error_message(&error));