summaryrefslogtreecommitdiff
path: root/vdr.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2001-03-31 10:32:58 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2001-03-31 10:32:58 +0200
commit378db17bee8dd5fcdcb4486900336048a35f7018 (patch)
treef06c03262d751003dd9a6c0539c0b9122d1f78bb /vdr.c
parent6ca89f0eb39999af534f51501775570e64295375 (diff)
downloadvdr-378db17bee8dd5fcdcb4486900336048a35f7018.tar.gz
vdr-378db17bee8dd5fcdcb4486900336048a35f7018.tar.bz2
New command line option -t
Diffstat (limited to 'vdr.c')
-rw-r--r--vdr.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/vdr.c b/vdr.c
index 938afcf0..71f3222b 100644
--- a/vdr.c
+++ b/vdr.c
@@ -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: