/[svn]/qsampler/trunk/src/qsamplerMainForm.cpp
ViewVC logotype

Diff of /qsampler/trunk/src/qsamplerMainForm.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3509 by capela, Tue Apr 2 17:55:00 2019 UTC revision 3510 by capela, Wed Apr 10 23:03:23 2019 UTC
# Line 89  static inline long lroundf ( float x ) Line 89  static inline long lroundf ( float x )
89  // All winsock apps needs this.  // All winsock apps needs this.
90  #if defined(__WIN32__) || defined(_WIN32) || defined(WIN32)  #if defined(__WIN32__) || defined(_WIN32) || defined(WIN32)
91  static WSADATA _wsaData;  static WSADATA _wsaData;
92    #undef HAVE_SIGNAL_H
93  #endif  #endif
94    
95    
# Line 99  static WSADATA _wsaData; Line 100  static WSADATA _wsaData;
100    
101  #include <QSocketNotifier>  #include <QSocketNotifier>
102    
103    #include <unistd.h>
104  #include <sys/types.h>  #include <sys/types.h>
105  #include <sys/socket.h>  #include <sys/socket.h>
   
106  #include <signal.h>  #include <signal.h>
107    
108  // File descriptor for SIGUSR1 notifier.  // File descriptor for SIGUSR1 notifier.
109  static int g_fdSigusr1[2];  static int g_fdSigusr1[2] = { -1, -1 };
110    
111  // Unix SIGUSR1 signal handler.  // Unix SIGUSR1 signal handler.
112  static void qsampler_sigusr1_handler ( int /* signo */ )  static void qsampler_sigusr1_handler ( int /* signo */ )
# Line 116  static void qsampler_sigusr1_handler ( i Line 117  static void qsampler_sigusr1_handler ( i
117  }  }
118    
119  // File descriptor for SIGTERM notifier.  // File descriptor for SIGTERM notifier.
120  static int g_fdSigterm[2];  static int g_fdSigterm[2] = { -1, -1 };
121    
122  // Unix SIGTERM signal handler.  // Unix SIGTERM signal handler.
123  static void qsampler_sigterm_handler ( int /* signo */ )  static void qsampler_sigterm_handler ( int /* signo */ )
# Line 249  MainForm::MainForm ( QWidget *pParent ) Line 250  MainForm::MainForm ( QWidget *pParent )
250                  SLOT(handle_sigusr1()));                  SLOT(handle_sigusr1()));
251    
252          // Install SIGUSR1 signal handler.          // Install SIGUSR1 signal handler.
253      struct sigaction sigusr1;          struct sigaction sigusr1;
254      sigusr1.sa_handler = qsampler_sigusr1_handler;          sigusr1.sa_handler = qsampler_sigusr1_handler;
255      sigemptyset(&sigusr1.sa_mask);          sigemptyset(&sigusr1.sa_mask);
256      sigusr1.sa_flags = 0;          sigusr1.sa_flags = 0;
257      sigusr1.sa_flags |= SA_RESTART;          sigusr1.sa_flags |= SA_RESTART;
258      ::sigaction(SIGUSR1, &sigusr1, NULL);          ::sigaction(SIGUSR1, &sigusr1, NULL);
259    
260          // Initialize file descriptors for SIGTERM socket notifier.          // Initialize file descriptors for SIGTERM socket notifier.
261          ::socketpair(AF_UNIX, SOCK_STREAM, 0, g_fdSigterm);          ::socketpair(AF_UNIX, SOCK_STREAM, 0, g_fdSigterm);

Legend:
Removed from v.3509  
changed lines
  Added in v.3510

  ViewVC Help
Powered by ViewVC