]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
In dbus_get_autolaunch_address() return all errors as dbus error
authorRalf Habacker <ralf.habacker@freenet.de>
Sat, 18 Apr 2020 08:52:37 +0000 (10:52 +0200)
committerRalf Habacker <ralf.habacker@freenet.de>
Mon, 27 Apr 2020 12:09:57 +0000 (12:09 +0000)
This provides a consistent error reporting.

Fixes #191

dbus/dbus-sysdeps-win.c

index 1f7d0ae29367d36520a278c5ac3b524406f8ae0b..964d5391e050451a731686e4107e944528a525cb 100644 (file)
@@ -3189,10 +3189,12 @@ _dbus_get_autolaunch_address (const char *scope, DBusString *address,
           *ext_idx = '\0';
           if (!SearchPathA (dbus_module_path, daemon_name, NULL, sizeof(dbus_exe_path), dbus_exe_path, &lpFile))
             {
-              dbus_set_error_const (error, DBUS_ERROR_FAILED, "could not find dbus-daemon executable");
+              dbus_set_error (error, DBUS_ERROR_FAILED,
+                              "Could not find dbus-daemon executable. "
+                              "Please add the path to %s to your PATH "
+                              "environment variable or start the daemon manually",
+                              daemon_name);
               retval = FALSE;
-              fprintf (stderr, "please add the path to %s to your PATH environment variable\n", daemon_name);
-              fprintf (stderr, "or start the daemon manually\n\n");
               goto out;
             }
           _dbus_verbose ("found dbus daemon executable at %s", dbus_module_path);