From 41fbcb09702de5b69b45c92f7a1d5b87153e96c8 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 11 Sep 2012 20:33:34 +0200 Subject: [PATCH] start SCRIPTs with-my_system Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3389defb1753dad0f9a5ea5f5aecca0477eff46f Author: Jacek Jendrzej Date: 2012-09-11 (Tue, 11 Sep 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/record.cpp | 8 +++++--- src/gui/audioplayer.cpp | 5 +++-- src/gui/filebrowser.cpp | 2 +- src/gui/movieplayer.cpp | 5 +++-- src/gui/scan.cpp | 5 +++-- src/neutrino.cpp | 11 ++++++----- 6 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 269a4b442..6fc811b67 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -40,13 +40,15 @@ #include #include #include +#include #include #include #include #include #include #include -#include +#include + #include #include @@ -1452,7 +1454,7 @@ bool CRecordManager::RunStartScript(void) return false; puts("[neutrino.cpp] executing " NEUTRINO_RECORDING_START_SCRIPT "."); - if (system(NEUTRINO_RECORDING_START_SCRIPT) != 0) { + if (my_system(NEUTRINO_RECORDING_START_SCRIPT,NULL,NULL) != 0) { perror(NEUTRINO_RECORDING_START_SCRIPT " failed"); return false; } @@ -1466,7 +1468,7 @@ bool CRecordManager::RunStopScript(void) return false; puts("[neutrino.cpp] executing " NEUTRINO_RECORDING_ENDED_SCRIPT "."); - if (system(NEUTRINO_RECORDING_ENDED_SCRIPT) != 0) { + if (my_system(NEUTRINO_RECORDING_ENDED_SCRIPT,NULL,NULL) != 0) { perror(NEUTRINO_RECORDING_ENDED_SCRIPT " failed"); return false; } diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 4de5e4b28..96424233b 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -66,6 +66,7 @@ #include #include +#include #include #include @@ -317,7 +318,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) g_Sectionsd->setPauseScanning(true); puts("[audioplayer.cpp] executing " AUDIOPLAYER_START_SCRIPT "."); - if (system(AUDIOPLAYER_START_SCRIPT) != 0) + if (my_system(AUDIOPLAYER_START_SCRIPT,NULL,NULL) != 0) perror("Datei " AUDIOPLAYER_START_SCRIPT " fehlt.Bitte erstellen, wenn gebraucht.\nFile " AUDIOPLAYER_START_SCRIPT " not found. Please create if needed.\n"); show(); @@ -329,7 +330,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_frameBuffer->paintBackground(); puts("[audioplayer.cpp] executing " AUDIOPLAYER_END_SCRIPT "."); - if (system(AUDIOPLAYER_END_SCRIPT) != 0) + if (my_system(AUDIOPLAYER_END_SCRIPT,NULL,NULL) != 0) perror("Datei " AUDIOPLAYER_END_SCRIPT " fehlt. Bitte erstellen, wenn gebraucht.\nFile " AUDIOPLAYER_END_SCRIPT " not found. Please create if needed.\n"); g_Zapit->unlockPlayBack(); diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 9bfc94f0e..62abedeae 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -61,7 +61,7 @@ #ifndef NEW_LIBCURL #include #endif - +#include #include #ifdef __USE_FILE_OFFSET64 diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index ca6be2dbc..a51e04ff9 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -175,7 +176,7 @@ int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey) startposition = 0; puts("[movieplayer.cpp] executing " MOVIEPLAYER_START_SCRIPT "."); - if (system(MOVIEPLAYER_START_SCRIPT) != 0) + if (my_system(MOVIEPLAYER_START_SCRIPT,NULL,NULL) != 0) perror(MOVIEPLAYER_START_SCRIPT " failed"); isMovieBrowser = false; @@ -213,7 +214,7 @@ int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey) bookmarkmanager->flush(); puts("[movieplayer.cpp] executing " MOVIEPLAYER_END_SCRIPT "."); - if (system(MOVIEPLAYER_END_SCRIPT) != 0) + if (my_system(MOVIEPLAYER_END_SCRIPT,NULL,NULL) != 0) perror(MOVIEPLAYER_END_SCRIPT " failed"); CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index 670afe1f4..7b66492b4 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -52,6 +52,7 @@ #include #include +#include #include #include @@ -248,7 +249,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) if(!manual) { g_RCInput->close_click(); - if (system(NEUTRINO_SCAN_START_SCRIPT) != 0) + if (my_system(NEUTRINO_SCAN_START_SCRIPT,NULL,NULL) != 0) perror(NEUTRINO_SCAN_START_SCRIPT " failed"); } @@ -310,7 +311,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) g_Zapit->stopScan(); if(!manual) { - if (system(NEUTRINO_SCAN_STOP_SCRIPT) != 0) + if (my_system(NEUTRINO_SCAN_STOP_SCRIPT,NULL,NULL) != 0) perror(NEUTRINO_SCAN_STOP_SCRIPT " failed"); g_RCInput->open_click(); } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 8d563a613..6879eaa1e 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -96,6 +96,7 @@ #include #include #include +#include #include @@ -1745,7 +1746,7 @@ void wake_up( bool &wakeup) if(!wakeup){ const char *neutrino_leave_deepstandby_script = CONFIGDIR "/deepstandby.off"; printf("[%s] executing %s\n",__FILE__ ,neutrino_leave_deepstandby_script); - if (system(neutrino_leave_deepstandby_script) != 0) + if (file_exists(neutrino_leave_deepstandby_script) && my_system(neutrino_leave_deepstandby_script,NULL,NULL) != 0) perror( neutrino_leave_deepstandby_script ); } #endif @@ -2686,7 +2687,7 @@ _repeat: return messages_return::handled; } else if( msg == NeutrinoMessages::ANNOUNCE_RECORD) { - system(NEUTRINO_RECORDING_TIMER_SCRIPT); + my_system(NEUTRINO_RECORDING_TIMER_SCRIPT,NULL,NULL); if (g_settings.recording_type == RECORDING_FILE) { char * recordingDir = ((CTimerd::RecordingInfo*)data)->recordingDir; for(int i=0 ; i < NETWORK_NFS_NR_OF_ENTRIES ; i++) { @@ -2946,7 +2947,7 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) if(retcode) { const char *neutrino_enter_deepstandby_script = CONFIGDIR "/deepstandby.on"; printf("[%s] executing %s\n",__FILE__ ,neutrino_enter_deepstandby_script); - if (system(neutrino_enter_deepstandby_script) != 0) + if (file_exists(neutrino_enter_deepstandby_script) && my_system(neutrino_enter_deepstandby_script,NULL,NULL) != 0) perror(neutrino_enter_deepstandby_script ); printf("entering off state\n"); @@ -3224,7 +3225,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) standby_channel_id = CZapit::getInstance()->GetCurrentChannelID(); puts("[neutrino.cpp] executing " NEUTRINO_ENTER_STANDBY_SCRIPT "."); - if (system(NEUTRINO_ENTER_STANDBY_SCRIPT) != 0) + if (my_system(NEUTRINO_ENTER_STANDBY_SCRIPT,NULL,NULL) != 0) perror(NEUTRINO_ENTER_STANDBY_SCRIPT " failed"); if(!CRecordManager::getInstance()->RecordingStatus()) @@ -3268,7 +3269,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) } puts("[neutrino.cpp] executing " NEUTRINO_LEAVE_STANDBY_SCRIPT "."); - if (system(NEUTRINO_LEAVE_STANDBY_SCRIPT) != 0) + if (my_system(NEUTRINO_LEAVE_STANDBY_SCRIPT,NULL,NULL) != 0) perror(NEUTRINO_LEAVE_STANDBY_SCRIPT " failed"); CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO);