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 <signal.h>
#include <vector>
#include "loggerwithfile.h"
#include "maincore.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 36 of file main.cpp.

References handler().

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

◆ handler()

void handler ( int  sig)

Definition at line 30 of file main.cpp.

30  {
31  fprintf(stderr, "quit the application by signal(%d).\n", sig);
32  QCoreApplication::quit();
33 }

◆ main()

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

Definition at line 102 of file main.cpp.

References qtwebapp::Logger::installMsgHandler().

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