test: restore the hwdb/udev rules on SIGINT

We can't call system() in the signal handler but we are allowed to fork. Do
that, update the hwdb and immediately exit the child again.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2016-07-20 08:45:22 +10:00
parent f9f4bb0266
commit 51fb42cb60

View file

@ -852,6 +852,12 @@ litest_signal(int sig)
/* in the sighandler, we can't free */
}
if (fork() == 0) {
/* child, we can run system() */
litest_reload_udev_rules();
exit(0);
}
exit(1);
}