summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2007-01-26 13:38:32 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2007-01-26 13:38:32 +0100
commitcb252863948b430e3ac28dc7aaa9cf19930af8b3 (patch)
tree60f7a6048b3c2971baec8f6f53ef346a857524e1 /config.c
parentd1d58251360547e434f363cdfcd35537b235f602 (diff)
downloadvdr-cb252863948b430e3ac28dc7aaa9cf19930af8b3.tar.gz
vdr-cb252863948b430e3ac28dc7aaa9cf19930af8b3.tar.bz2
Now using cPipe instead of popen() in cCommand::Execute()
Diffstat (limited to 'config.c')
-rw-r--r--config.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/config.c b/config.c
index f3942668..6ac72a8f 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.146 2006/07/22 11:57:51 kls Exp $
+ * $Id: config.c 1.147 2007/01/26 13:32:19 kls Exp $
*/
#include "config.h"
@@ -67,8 +67,8 @@ const char *cCommand::Execute(const char *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) {
+ cPipe p;
+ if (p.Open(cmd, "r")) {
int l = 0;
int c;
while ((c = fgetc(p)) != EOF) {
@@ -78,7 +78,7 @@ const char *cCommand::Execute(const char *Parameters)
}
if (result)
result[l] = 0;
- pclose(p);
+ p.Close();
}
else
esyslog("ERROR: can't open pipe for command '%s'", cmd);