diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2001-04-01 11:18:28 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2001-04-01 11:18:28 +0200 |
commit | 28130daef7b11beeafaf0c59dd45e8f0aafd6d5b (patch) | |
tree | 9aca64bba0100c1284b4685d86e2f8bdf1303d07 | |
parent | f3f2d4577dc97946b368bc42ee7fec2489c3ab51 (diff) | |
download | vdr-28130daef7b11beeafaf0c59dd45e8f0aafd6d5b.tar.gz vdr-28130daef7b11beeafaf0c59dd45e8f0aafd6d5b.tar.bz2 |
No longer calling 'abort()'
-rw-r--r-- | HISTORY | 2 | ||||
-rwxr-xr-x | runvdr | 3 | ||||
-rw-r--r-- | vdr.c | 20 |
3 files changed, 14 insertions, 11 deletions
@@ -445,3 +445,5 @@ Video Disk Recorder Revision History systems with three or more DVB cards. - Added the "statdvb2vdr" tool from Hans-Peter Raschke. - Fixed a segfault that sometimes happened when killing VDR. +- VDR now returns an exit status of '2' in case of an error at startup, instead + of terminating with 'abort()' (which caused a core dump). @@ -9,7 +9,8 @@ KILLPROC="/sbin/killproc -TERM" while (true) do # (cd $DVBDIR; make reload) # sleep 3 - if $VDRCMD; then exit; fi + $VDRCMD + if test $? != 1; then exit; fi date echo "restarting VDR" $KILLPROC $VDRPRG @@ -22,7 +22,7 @@ * * The project's page is at http://www.cadsoft.de/people/kls/vdr * - * $Id: vdr.c 1.55 2001/03/31 10:18:25 kls Exp $ + * $Id: vdr.c 1.56 2001/04/01 11:16:54 kls Exp $ */ #include <getopt.h> @@ -104,7 +104,7 @@ int main(int argc, char *argv[]) } } fprintf(stderr, "vdr: invalid DVB device number: %s\n", optarg); - abort(); + return 2; break; case 'h': printf("Usage: vdr [OPTION]\n\n" // for easier orientation, this is column 80| " -c DIR, --config=DIR read config files from DIR (default is to read them\n" @@ -139,13 +139,13 @@ int main(int argc, char *argv[]) } } fprintf(stderr, "vdr: invalid log level: %s\n", optarg); - abort(); + return 2; break; case 'p': if (isnumber(optarg)) SVDRPport = atoi(optarg); else { fprintf(stderr, "vdr: invalid port number: %s\n", optarg); - abort(); + return 2; } break; case 't': Terminal = optarg; @@ -162,9 +162,9 @@ int main(int argc, char *argv[]) } } fprintf(stderr, "vdr: invalid watchdog timeout: %s\n", optarg); - abort(); + return 2; break; - default: abort(); + default: return 2; } } @@ -177,7 +177,7 @@ int main(int argc, char *argv[]) if (!DirectoryOk(VideoDirectory, true)) { fprintf(stderr, "vdr: can't access video directory %s\n", VideoDirectory); - abort(); + return 2; } // Daemon mode: @@ -188,7 +188,7 @@ int main(int argc, char *argv[]) if (pid < 0) { fprintf(stderr, "%m\n"); esyslog(LOG_ERR, "ERROR: %m"); - abort(); + return 2; } if (pid != 0) return 0; // initial program immediately returns @@ -197,7 +197,7 @@ int main(int argc, char *argv[]) fclose(stderr); #else fprintf(stderr, "vdr: can't run in daemon mode with DEBUG_OSD or REMOTE_KBD on!\n"); - abort(); + return 2; #endif } else if (Terminal) { @@ -227,7 +227,7 @@ int main(int argc, char *argv[]) // DVB interfaces: if (!cDvbApi::Init()) - abort(); + return 2; cDvbApi::SetPrimaryDvbApi(Setup.PrimaryDVB); |