mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2025-05-20 07:26:58 -04:00
Handle unix signals
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include <QtDBus>
|
||||
#include "gpservice.h"
|
||||
#include "singleapplication.h"
|
||||
#include "sigwatch.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
@@ -12,7 +13,14 @@ int main(int argc, char *argv[])
|
||||
return 1;
|
||||
}
|
||||
|
||||
new GPService;
|
||||
GPService service;
|
||||
|
||||
UnixSignalWatcher sigwatch;
|
||||
sigwatch.watchForSignal(SIGINT);
|
||||
sigwatch.watchForSignal(SIGTERM);
|
||||
sigwatch.watchForSignal(SIGQUIT);
|
||||
sigwatch.watchForSignal(SIGHUP);
|
||||
QObject::connect(&sigwatch, SIGNAL(unixSignal(int)), &service, SLOT(quit()));
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
Reference in New Issue
Block a user