diff options
author | Max Kellermann <max@duempel.org> | 2014-12-05 00:12:44 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-12-05 00:21:48 +0100 |
commit | e5ab456df3a7c8fbb18763386aec1a3c2b4edf88 (patch) | |
tree | 69cb075ada9b3749ba2b10990059e0c83cc2f1bf /src/win32 | |
parent | 08bf4f74a99cb542a20e18b896b8565f6bf1f37a (diff) | |
download | mpd-e5ab456df3a7c8fbb18763386aec1a3c2b4edf88.tar.gz mpd-e5ab456df3a7c8fbb18763386aec1a3c2b4edf88.tar.xz mpd-e5ab456df3a7c8fbb18763386aec1a3c2b4edf88.zip |
Win32Main: use FatalSystemError()
Diffstat (limited to 'src/win32')
-rw-r--r-- | src/win32/Win32Main.cxx | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/src/win32/Win32Main.cxx b/src/win32/Win32Main.cxx index 75a1e9a23..5d1f50895 100644 --- a/src/win32/Win32Main.cxx +++ b/src/win32/Win32Main.cxx @@ -29,8 +29,6 @@ #include <cstdlib> #include <atomic> -#include <glib.h> - #include <windows.h> static int service_argc; @@ -82,19 +80,12 @@ service_dispatcher(gcc_unused DWORD control, gcc_unused DWORD event_type, static void WINAPI service_main(gcc_unused DWORD argc, gcc_unused CHAR *argv[]) { - DWORD error_code; - gchar* error_message; - service_handle = RegisterServiceCtrlHandlerEx(service_name, service_dispatcher, nullptr); - if (service_handle == 0) { - error_code = GetLastError(); - error_message = g_win32_error_message(error_code); - FormatFatalError("RegisterServiceCtrlHandlerEx() failed: %s", - error_message); - } + if (service_handle == 0) + FatalSystemError("RegisterServiceCtrlHandlerEx() failed"); service_notify_status(SERVICE_START_PENDING); mpd_main(service_argc, service_argv); @@ -132,7 +123,6 @@ console_handler(DWORD event) int win32_main(int argc, char *argv[]) { DWORD error_code; - gchar* error_message; service_argc = argc; service_argv = argv; @@ -149,9 +139,7 @@ int win32_main(int argc, char *argv[]) return mpd_main(argc, argv); } - error_message = g_win32_error_message(error_code); - FormatFatalError("StartServiceCtrlDispatcher() failed: %s", - error_message); + FatalSystemError("StartServiceCtrlDispatcher() failed", error_code); } void win32_app_started() |