mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-10-11 18:08:08 +00:00
[c-host] add app_quit for clean shutdown support
This commit is contained in:
@@ -28,6 +28,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <pthread.h>
|
||||
#include <signal.h>
|
||||
|
||||
struct app
|
||||
{
|
||||
@@ -57,6 +58,12 @@ struct osThreadHandle
|
||||
int resultCode;
|
||||
};
|
||||
|
||||
void sigHandler(int signo)
|
||||
{
|
||||
DEBUG_INFO("SIGINT");
|
||||
app_quit();
|
||||
}
|
||||
|
||||
int main(int argc, char * argv[])
|
||||
{
|
||||
static struct option longOptions[] =
|
||||
@@ -160,8 +167,9 @@ int main(int argc, char * argv[])
|
||||
DEBUG_INFO("KVMFR Device : %s", file);
|
||||
}
|
||||
|
||||
bool termSig = false;
|
||||
int result = app_main(&termSig);
|
||||
signal(SIGINT, sigHandler);
|
||||
|
||||
int result = app_main();
|
||||
os_shmemUnmap();
|
||||
close(app.shmFD);
|
||||
|
||||
|
Reference in New Issue
Block a user