From: Ralf Habacker Date: Mon, 22 Nov 2021 07:43:37 +0000 (+0100) Subject: tools/dbus-run-session.c: use _dbus_win_set_error_from_last_error() on remaining... X-Git-Tag: dbus-1.13.20~27^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2334307fbd093ad75f23cff19d9e44a956cccf68;p=thirdparty%2Fdbus.git tools/dbus-run-session.c: use _dbus_win_set_error_from_last_error() on remaining locations The previously used function _dbus_win_stderr_win_error() has been removed because it is no longer used. --- diff --git a/dbus/dbus-sysdeps-util-win.c b/dbus/dbus-sysdeps-util-win.c index 6bb62aed3..4e23b4947 100644 --- a/dbus/dbus-sysdeps-util-win.c +++ b/dbus/dbus-sysdeps-util-win.c @@ -1674,16 +1674,3 @@ void _dbus_daemon_report_stopping (void) { } - -void -_dbus_win_stderr_win_error (const char *app, - const char *message, - unsigned long code) -{ - DBusError error; - - dbus_error_init (&error); - _dbus_win_set_error_from_win_error (&error, code); - fprintf (stderr, "%s: %s: %s\n", app, message, error.message); - dbus_error_free (&error); -} diff --git a/dbus/dbus-sysdeps-win.h b/dbus/dbus-sysdeps-win.h index cbacd60cb..2775cfc63 100644 --- a/dbus/dbus-sysdeps-win.h +++ b/dbus/dbus-sysdeps-win.h @@ -46,9 +46,6 @@ const char* _dbus_win_error_from_last_error (void); dbus_bool_t _dbus_win_startup_winsock (void); void _dbus_win_warn_win_error (const char *message, unsigned long code); -void _dbus_win_stderr_win_error (const char *app, - const char *message, - unsigned long code); DBUS_PRIVATE_EXPORT char * _dbus_win_error_string (int error_number); DBUS_PRIVATE_EXPORT diff --git a/tools/dbus-run-session.c b/tools/dbus-run-session.c index c8b2920e6..46fa5c45c 100644 --- a/tools/dbus-run-session.c +++ b/tools/dbus-run-session.c @@ -501,14 +501,14 @@ run_session (const char *dbus_daemon, app_handle = _dbus_spawn_program (argv[prog_arg], argv + prog_arg, env, FALSE); if (!app_handle) { - _dbus_win_stderr_win_error (me, "unable to start child process", GetLastError ()); + _dbus_win_set_error_from_last_error (&error, "Unable to start child process"); goto out; } WaitForSingleObject (app_handle, INFINITE); if (!GetExitCodeProcess (app_handle, &exit_code)) { - _dbus_win_stderr_win_error (me, "could not fetch exit code", GetLastError ()); + _dbus_win_set_error_from_last_error (&error, "Could not fetch exit code"); goto out; } ret = exit_code;