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 | |
parent | e83482945d34cf956599b3728b0bd413cad3cdc4 (diff) | |
download | vdr-6a8e2a99cbfb1544e6b79f2e58697a44cfe4ec73.tar.gz vdr-6a8e2a99cbfb1544e6b79f2e58697a44cfe4ec73.tar.bz2 |
Now using daemon() instead of fork() to run VDR in daemon mode
-rw-r--r-- | CONTRIBUTORS | 3 | ||||
-rw-r--r-- | HISTORY | 3 | ||||
-rw-r--r-- | vdr.c | 10 |
3 files changed, 7 insertions, 9 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 59758469..c8e27dd4 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -1505,3 +1505,6 @@ Alexander Rieger <Alexander.Rieger@inka.de> Philip Prindeville <philipp_subx@redfish-solutions.com> for updates to 'sources.conf' + +Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> + for making VDR use use daemon() instead of fork() to run in daemon mode @@ -3886,6 +3886,7 @@ Video Disk Recorder Revision History - The 'sub-title' and 'bottom text' in the CAM menu can now consist of several lines. - Improved the CAM enquiry menu. -2005-10-08: Version 1.3.35 +2005-10-09: Version 1.3.35 - Updated 'sources.conf' (thanks to Philip Prindeville). +- Now using daemon() instead of fork() to run VDR in daemon mode (thanks to Enrico Scholz). @@ -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 |