summaryrefslogtreecommitdiff
path: root/vdr.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2001-04-01 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2001-04-01 18:00:00 +0200
commit610c5600df98b35226536ffe92b1fd231128c7d4 (patch)
treef0df8ce83dd3e4829be7def61126871f425e2f23 /vdr.c
parentf2937af95ceaf3a52c327e96571367ef5475b3a1 (diff)
downloadvdr-patch-lnbsharing-610c5600df98b35226536ffe92b1fd231128c7d4.tar.gz
vdr-patch-lnbsharing-610c5600df98b35226536ffe92b1fd231128c7d4.tar.bz2
Version 0.72vdr-0.72
- Fixed SVDRP commands LSTC and LSTT to make them return an error message if no channels or timers are defined. - Enhanced 'channels.conf.cable' (thanks to Hans-Peter Raschke). - Fixed switching to another channel via the EPG while a recording is being replayed. - Fixed a memory leak in the EIT processor that happened when the system time was set. - Removed some redundant code from the cListBase destructor. - Fixed internationalization of some Main menu texts. - Updated 'channels.conf' after the recent changes of Premiere World (thanks to Axel Gruber). - Redesigned the ring buffer to make it work with two separate threads for input and output (also prepared for using a remultiplexer). - Fixed setting system time from transponders. - Fixed a segfault in the Schedule menu in case there is no EPG information. - The 'runvdr' script now kills any leftover vdr threads before restarting it. - Fixed a problem with Daylight Saving Time when displaying the times of recordings. - Added Dutch language texts (thanks to Arnold Niessen). - The new command line option -t can be used to set the controlling terminal (thanks to Jürgen Sauer). This is especially useful when starting VDR through an entry in /etc/inittab (see INSTALL). - Since the CAM module only works if it is installed in the "highest" DVB card, recordings now search for a free DVB card from lowest to highest index (as opposed to the previous "highest to lowest" search) in order to not use the CAM card for FTA recordings unless necessary. This is only important for 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). - SVDRP now also works with clients that don't do line buffering (like the Windows 'telnet'). - Empty lines in config files no longer cause error messages. - New SVDRP command LSTE to list the EPG data. - The SVDRP HELP command now prints the topics in several columns.
Diffstat (limited to 'vdr.c')
-rw-r--r--vdr.c36
1 files changed, 24 insertions, 12 deletions
diff --git a/vdr.c b/vdr.c
index 938afcf..8ed209a 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.56 2001/04/01 11:16:54 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;
@@ -102,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"
@@ -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,
@@ -136,15 +139,17 @@ 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;
+ break;
case 'v': VideoDirectory = optarg;
while (optarg && *optarg && optarg[strlen(optarg) - 1] == '/')
optarg[strlen(optarg) - 1] = 0;
@@ -157,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;
}
}
@@ -172,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:
@@ -183,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
@@ -192,9 +197,16 @@ 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) {
+ // 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:
@@ -215,7 +227,7 @@ int main(int argc, char *argv[])
// DVB interfaces:
if (!cDvbApi::Init())
- abort();
+ return 2;
cDvbApi::SetPrimaryDvbApi(Setup.PrimaryDVB);