summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2002-10-13 12:14:49 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2002-10-13 12:14:49 +0200
commit95c8c2b60cfa455520798ea4db2a071ed18c2a2c (patch)
tree54346d4779f50d6caee950da353811239897d675 /config.c
parent44cb1a79a5ef620f317102cdae4c4c8780f250af (diff)
downloadvdr-95c8c2b60cfa455520798ea4db2a071ed18c2a2c.tar.gz
vdr-95c8c2b60cfa455520798ea4db2a071ed18c2a2c.tar.bz2
New configuration file 'reccmds.conf'
Diffstat (limited to 'config.c')
-rw-r--r--config.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/config.c b/config.c
index ad9282be..d9cdb43c 100644
--- a/config.c
+++ b/config.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: config.c 1.108 2002/10/13 08:52:25 kls Exp $
+ * $Id: config.c 1.109 2002/10/13 10:03:49 kls Exp $
*/
#include "config.h"
@@ -391,12 +391,16 @@ bool cCommand::Parse(const char *s)
return false;
}
-const char *cCommand::Execute(void)
+const char *cCommand::Execute(const char *Parameters)
{
- dsyslog("executing command '%s'", command);
free(result);
result = NULL;
- FILE *p = popen(command, "r");
+ char *cmdbuf = NULL;
+ if (Parameters)
+ asprintf(&cmdbuf, "%s %s", command, Parameters);
+ const char *cmd = cmdbuf ? cmdbuf : command;
+ dsyslog("executing command '%s'", cmd);
+ FILE *p = popen(cmd, "r");
if (p) {
int l = 0;
int c;
@@ -410,7 +414,8 @@ const char *cCommand::Execute(void)
pclose(p);
}
else
- esyslog("ERROR: can't open pipe for command '%s'", command);
+ esyslog("ERROR: can't open pipe for command '%s'", cmd);
+ free(cmdbuf);
return result;
}
@@ -469,6 +474,7 @@ bool cCaDefinition::Parse(const char *s)
// -- cCommands --------------------------------------------------------------
cCommands Commands;
+cCommands RecordingCommands;
// -- cTimers ----------------------------------------------------------------