aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-18 18:29:27 +0100
committerMax Kellermann <max@duempel.org>2009-01-18 18:29:27 +0100
commitbfcaecabbda1ec9473a92f6a413a51db564d9d6e (patch)
treebb7018873e10dc5bcbdd77ada7c172af872ee6d0 /src/main.c
parent0dd2dfff9d7fd8208d87eae98c6cd8976d4b2e38 (diff)
downloadmpd-bfcaecabbda1ec9473a92f6a413a51db564d9d6e.tar.gz
mpd-bfcaecabbda1ec9473a92f6a413a51db564d9d6e.tar.xz
mpd-bfcaecabbda1ec9473a92f6a413a51db564d9d6e.zip
daemon: added daemonize_init(), daemonize_finish()
The constructor/destructor functions parse and free the configuration properly. This way, we don't have to load the pid file path more than once.
Diffstat (limited to '')
-rw-r--r--src/main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index aeb067f9b..b42433ec8 100644
--- a/src/main.c
+++ b/src/main.c
@@ -201,6 +201,9 @@ int main(int argc, char *argv[])
parseOptions(argc, argv, &options);
+ daemonize_init(config_get_string(CONF_USER, NULL),
+ config_get_path(CONF_PID_FILE));
+
if (options.kill)
daemonize_kill();
@@ -295,13 +298,13 @@ int main(int argc, char *argv[])
archive_plugin_deinit_all();
#endif
music_pipe_free();
- daemonize_delete_pidfile();
config_global_finish();
tag_pool_deinit();
songvec_deinit();
dirvec_deinit();
idle_deinit();
stats_global_finish();
+ daemonize_finish();
close_log_files();
return EXIT_SUCCESS;