main: moved code to daemon.c

Moved changeToUser(), cleanUpPidFile(), killFromPidFile() to
daemon.c.  These are daemonization functions.
This commit is contained in:
Max Kellermann
2009-01-18 17:15:34 +01:00
parent 1f0dfb4407
commit 90b34f8e6f
3 changed files with 119 additions and 98 deletions

View File

@@ -21,13 +21,32 @@
#include "cmdline.h"
/**
* Kill the MPD which is currently running, pid determined from the
* pid file.
*/
void
daemonize_kill(void);
/**
* Close stdin (fd 0) and re-open it as /dev/null.
*/
void
daemonize_close_stdin(void);
/**
* Change to the configured Unix user.
*/
void
daemonize_set_user(void);
void
daemonize(Options *options);
/**
* Deletes the pidfile which was created when MPD started.
*/
void
daemonize_delete_pidfile(void);
#endif