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.
This commit is contained in:
Max Kellermann
2009-01-18 18:29:27 +01:00
parent 0dd2dfff9d
commit bfcaecabbd
3 changed files with 73 additions and 46 deletions

View File

@@ -21,6 +21,12 @@
#include "cmdline.h"
void
daemonize_init(const char *user, const char *pidfile);
void
daemonize_finish(void);
/**
* Kill the MPD which is currently running, pid determined from the
* pid file.
@@ -43,10 +49,4 @@ daemonize_set_user(void);
void
daemonize(Options *options);
/**
* Deletes the pidfile which was created when MPD started.
*/
void
daemonize_delete_pidfile(void);
#endif