diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2005-10-09 10:05:21 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2005-10-09 10:05:21 +0200 |
commit | 6a8e2a99cbfb1544e6b79f2e58697a44cfe4ec73 (patch) | |
tree | 6ea92767eb56eca7ab99fadd67739f34b420ab42 /vdr.c | |
parent | e83482945d34cf956599b3728b0bd413cad3cdc4 (diff) | |
download | vdr-6a8e2a99cbfb1544e6b79f2e58697a44cfe4ec73.tar.gz vdr-6a8e2a99cbfb1544e6b79f2e58697a44cfe4ec73.tar.bz2 |
Now using daemon() instead of fork() to run VDR in daemon mode
Diffstat (limited to 'vdr.c')
-rw-r--r-- | vdr.c | 10 |
1 files changed, 2 insertions, 8 deletions
@@ -22,7 +22,7 @@ * * The project's page is at http://www.cadsoft.de/vdr * - * $Id: vdr.c 1.217 2005/09/24 13:27:26 kls Exp $ + * $Id: vdr.c 1.218 2005/10/09 10:01:45 kls Exp $ */ #include <getopt.h> @@ -370,17 +370,11 @@ int main(int argc, char *argv[]) // Daemon mode: if (DaemonMode) { - pid_t pid = fork(); - if (pid < 0) { + if (daemon(1, 0) == -1) { fprintf(stderr, "%m\n"); esyslog("ERROR: %m"); return 2; } - if (pid != 0) - return 0; // initial program immediately returns - fclose(stdin); - fclose(stdout); - fclose(stderr); } else if (Terminal) { // Claim new controlling terminal |