summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <withnall@endlessm.com>2020-03-06 12:53:00 +0000
committerBenjamin Berg <benjamin@sipsolutions.net>2020-04-25 19:23:09 +0000
commit523ffa148ce16773c2d9f711edb2c0424411d7ac (patch)
treecfd50291def305033ddb5bfd3529db8ddb697a75
parent3967b956d2370e1955efb52c0b0c25ea956c6645 (diff)
downloadgnome-settings-daemon-523ffa148ce16773c2d9f711edb2c0424411d7ac.tar.gz
sharing: Don’t warn about starting/stopping services which don’t exist
This squashes the following warning from the journal: ``` Mar 06 12:37:52 endless gsd-sharing[33186]: Failed to StopUnit service: GDBus.Error:org.freedesktop.systemd1.NoSuchUnit: Unit rygel.service not loaded. Mar 06 12:37:52 endless gsd-sharing[33186]: Failed to StopUnit service: GDBus.Error:org.freedesktop.systemd1.NoSuchUnit: Unit gnome-remote-desktop.service not loaded. ``` Signed-off-by: Philip Withnall <withnall@endlessm.com>
-rw-r--r--plugins/sharing/gsd-sharing-manager.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/sharing/gsd-sharing-manager.c b/plugins/sharing/gsd-sharing-manager.c
index ab3d83c2..43067ccd 100644
--- a/plugins/sharing/gsd-sharing-manager.c
+++ b/plugins/sharing/gsd-sharing-manager.c
@@ -114,7 +114,10 @@ handle_unit_cb (GObject *source_object,
ret = g_dbus_connection_call_finish (G_DBUS_CONNECTION (source_object),
res, &error);
if (!ret) {
- if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ g_autofree gchar *remote_error = g_dbus_error_get_remote_error (error);
+
+ if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) &&
+ g_strcmp0 (remote_error, "org.freedesktop.systemd1.NoSuchUnit") != 0)
g_warning ("Failed to %s service: %s", operation, error->message);
g_error_free (error);
return;