diff options
author | Max Kellermann <max@duempel.org> | 2009-09-24 21:40:04 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-09-24 21:40:04 +0200 |
commit | 308b3f2337f100b5d27fa2af50bf929caff4a7d4 (patch) | |
tree | d85afd52f91b2e54870aac4ef2b55135a604713d /src/main.c | |
parent | 1e561079676a4774afa8b9c405d98001915322f3 (diff) | |
download | mpd-308b3f2337f100b5d27fa2af50bf929caff4a7d4.tar.gz mpd-308b3f2337f100b5d27fa2af50bf929caff4a7d4.tar.xz mpd-308b3f2337f100b5d27fa2af50bf929caff4a7d4.zip |
listen: handle fatal errors with GError
Don't call g_error(), which will abort the process and dump core.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c index 775ae9a72..0d7cbf1ed 100644 --- a/src/main.c +++ b/src/main.c @@ -273,6 +273,8 @@ int main(int argc, char *argv[]) struct options options; clock_t start; bool create_db; + GError *error = NULL; + bool success; daemonize_close_stdin(); @@ -301,7 +303,12 @@ int main(int argc, char *argv[]) tag_lib_init(); log_init(options.verbose, options.log_stderr); - listen_global_init(); + success = listen_global_init(&error); + if (!success) { + g_warning("%s", error->message); + g_error_free(error); + return EXIT_FAILURE; + } daemonize_set_user(); |