From 9706daedb3aeb2154e532d8a586f59b3166f8279 Mon Sep 17 00:00:00 2001 From: Jochen Dolze Date: Sat, 28 Apr 2012 21:00:18 +0200 Subject: Moved script error output --- source.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/source.cpp b/source.cpp index 501e700..676e806 100644 --- a/source.cpp +++ b/source.cpp @@ -619,6 +619,23 @@ int cEPGSource::Execute(cEPGExecutor &myExecutor) if (r_out) r_out[l_out]=0; if (r_err) r_err[l_err]=0; + if (r_err) + { + char *saveptr; + char *pch=strtok_r(r_err,"\n",&saveptr); + char *last=(char *) ""; + while (pch) + { + if (strcmp(last,pch)) + { + esyslogs(this,"(script) %s",pch); + last=pch; + } + pch=strtok_r(NULL,"\n",&saveptr); + } + free(r_err); + } + if (usepipe) { int status; @@ -671,23 +688,6 @@ int cEPGSource::Execute(cEPGExecutor &myExecutor) { lastretcode=ret; } - - if (r_err) - { - char *saveptr; - char *pch=strtok_r(r_err,"\n",&saveptr); - char *last=(char *) ""; - while (pch) - { - if (strcmp(last,pch)) - { - esyslogs(this,"%s",pch); - last=pch; - } - pch=strtok_r(NULL,"\n",&saveptr); - } - free(r_err); - } running=false; return ret; } -- cgit v1.2.3