[c-host] add app_quit for clean shutdown support

This commit is contained in:
Geoffrey McRae
2019-03-02 20:31:33 +11:00
parent b29de8f370
commit 7285f9e9ad
4 changed files with 22 additions and 9 deletions

View File

@@ -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);