SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Functions
main.cpp File Reference
#include <QCoreApplication>
#include <QSysInfo>
#include <QTimer>
#include <signal.h>
#include <unistd.h>
#include <vector>
#include "loggerwithfile.h"
#include "mainbench.h"
#include "dsp/dsptypes.h"
+ Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

void handler (int sig)
 
void catchUnixSignals (const std::vector< int > &quitSignals)
 
int main (int argc, char *argv[])
 

Function Documentation

◆ catchUnixSignals()

void catchUnixSignals ( const std::vector< int > &  quitSignals)

Definition at line 38 of file main.cpp.

References handler().

38  {
39  sigset_t blocking_mask;
40  sigemptyset(&blocking_mask);
41 
42  for (std::vector<int>::const_iterator it = quitSignals.begin(); it != quitSignals.end(); ++it) {
43  sigaddset(&blocking_mask, *it);
44  }
45 
46  struct sigaction sa;
47  sa.sa_handler = handler;
48  sa.sa_mask = blocking_mask;
49  sa.sa_flags = 0;
50 
51  for (std::vector<int>::const_iterator it = quitSignals.begin(); it != quitSignals.end(); ++it) {
52  sigaction(*it, &sa, 0);
53  }
54 }
void handler(int sig)
Definition: main.cpp:32
+ Here is the call graph for this function:

◆ handler()

void handler ( int  sig)

Definition at line 32 of file main.cpp.

Referenced by catchUnixSignals(), qtwebapp::HttpConnectionHandlerPool::cleanup(), qtwebapp::HttpConnectionHandlerPool::getConnectionHandler(), and qtwebapp::HttpConnectionHandlerPool::~HttpConnectionHandlerPool().

32  {
33  fprintf(stderr, "quit the application by signal(%d).\n", sig);
34  QCoreApplication::quit();
35 }
+ Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 106 of file main.cpp.

References qtwebapp::Logger::installMsgHandler().

107  {
109  logger->installMsgHandler();
110  int res = runQtApplication(argc, argv, logger);
111  qWarning("SDRangel quit.");
112  return res;
113  }
void installMsgHandler()
Definition: logger.cpp:111
+ Here is the call graph for this function: