diff options
Diffstat (limited to 'vdr.c')
-rw-r--r-- | vdr.c | 18 |
1 files changed, 15 insertions, 3 deletions
@@ -22,7 +22,7 @@ * * The project's page is at http://www.cadsoft.de/people/kls/vdr * - * $Id: vdr.c 1.54 2001/02/24 16:18:43 kls Exp $ + * $Id: vdr.c 1.55 2001/03/31 10:18:25 kls Exp $ */ #include <getopt.h> @@ -74,6 +74,7 @@ int main(int argc, char *argv[]) const char *ConfigDirectory = NULL; bool DaemonMode = false; int WatchdogTimeout = DEFAULTWATCHDOG; + char *Terminal = NULL; static struct option long_options[] = { { "config", required_argument, NULL, 'c' }, @@ -84,12 +85,13 @@ int main(int argc, char *argv[]) { "port", required_argument, NULL, 'p' }, { "video", required_argument, NULL, 'v' }, { "watchdog", required_argument, NULL, 'w' }, + { "terminal", required_argument, NULL, 't' }, { 0 } }; int c; int option_index = 0; - while ((c = getopt_long(argc, argv, "c:dD:hl:p:v:w:", long_options, &option_index)) != -1) { + while ((c = getopt_long(argc, argv, "c:dD:hl:p:v:w:t:", long_options, &option_index)) != -1) { switch (c) { case 'c': ConfigDirectory = optarg; break; @@ -117,9 +119,10 @@ int main(int argc, char *argv[]) " 2 = errors and info, 3 = errors, info and debug\n" " -p PORT, --port=PORT use PORT for SVDRP (default: %d)\n" " 0 turns off SVDRP\n" - " -v DIR, --video=DIR use DIR as video directory (default is %s)\n" + " -v DIR, --video=DIR use DIR as video directory (default: %s)\n" " -w SEC, --watchdog=SEC activate the watchdog timer with a timeout of SEC\n" " seconds (default: %d); '0' disables the watchdog\n" + " -t TTY, --terminal=TTY controlling tty\n" "\n" "Report bugs to <vdr-bugs@cadsoft.de>\n", DEFAULTSVDRPPORT, @@ -145,6 +148,8 @@ int main(int argc, char *argv[]) abort(); } break; + case 't': Terminal = optarg; + break; case 'v': VideoDirectory = optarg; while (optarg && *optarg && optarg[strlen(optarg) - 1] == '/') optarg[strlen(optarg) - 1] = 0; @@ -195,6 +200,13 @@ int main(int argc, char *argv[]) abort(); #endif } + else if (Terminal) { + // Claim new controlling terminal + stdin = freopen(Terminal, "r", stdin); + stdout = freopen(Terminal, "w", stdout); + stderr = freopen(Terminal, "w", stderr); + } + isyslog(LOG_INFO, "VDR version %s started", VDRVERSION); // Configuration data: |