Advertisement
svenhoefer

Untitled

Mar 18th, 2017
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.07 KB | None | 0 0
  1. diff --git a/src/neutrino.cpp b/src/neutrino.cpp
  2. index 62b3a41..cd6e442 100644
  3. --- a/src/neutrino.cpp
  4. +++ b/src/neutrino.cpp
  5. @@ -3860,6 +3860,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
  6.  
  7.  extern time_t timer_minutes;//timermanager.cpp
  8.  extern bool timer_is_rec;//timermanager.cpp
  9. +extern bool timer_is_plugin;//timermanager.cpp //NI
  10.  
  11.  void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode)
  12.  {
  13. @@ -3904,7 +3905,7 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode)
  14.         CVFD::getInstance()->setMode(CVFD::MODE_SHUTDOWN);
  15.  
  16.         stop_daemons(true /*retcode*/);//need here for timer_is_rec before saveSetup
  17. -       g_settings.shutdown_timer_record_type = timer_is_rec;
  18. +       g_settings.shutdown_timer_record_type = (timer_is_rec || timer_is_plugin); //NI
  19.         saveSetup(NEUTRINO_SETTINGS_FILE);
  20.  
  21.         if(retcode) {
  22. diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp
  23. index feb437e..309629e 100644
  24. --- a/src/timerd/timermanager.cpp
  25. +++ b/src/timerd/timermanager.cpp
  26. @@ -47,6 +47,7 @@
  27.  extern bool timeset;
  28.  time_t timer_minutes;
  29.  bool timer_is_rec;
  30. +bool timer_is_plugin; //NI
  31.  static pthread_mutex_t tm_eventsMutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
  32.  
  33.  //------------------------------------------------------------
  34. @@ -62,6 +63,7 @@ void CTimerManager::Init(void)
  35.     m_saveEvents = false;
  36.     m_isTimeSet = false;
  37.     timer_is_rec = false;
  38. +   timer_is_plugin = false; //NI
  39.     wakeup = 0;
  40.     shutdown_eventID = -1;
  41.     loadRecordingSafety();
  42. @@ -724,6 +726,7 @@ bool CTimerManager::shutdown()
  43.     time_t nextAnnounceTime=0;
  44.     bool status=false;
  45.     timer_is_rec = false;
  46. +   timer_is_plugin = false; //NI
  47.     dprintf("stopping timermanager thread ...\n");
  48.  
  49.     dprintf("Waiting for timermanager thread to terminate ...\n");
  50. @@ -763,6 +766,11 @@ bool CTimerManager::shutdown()
  51.                     timer_is_rec = true;
  52.                 else
  53.                     timer_is_rec = false;
  54. +               //NI
  55. +               if ( event->eventType == CTimerd::TIMER_EXEC_PLUGIN )
  56. +                   timer_is_plugin = true;
  57. +               else
  58. +                   timer_is_plugin = false;
  59.             }
  60.         }
  61.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement