summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2016-07-20 08:45:22 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2016-08-02 10:19:38 +1000
commit51fb42cb602ed08f14b49121e02dbf0c5c5e1877 (patch)
tree0bc70a5914d2e0c2cadd3f58c7c469de9f2b2b83
parentf9f4bb026603738dda0367a3eb4cfb7289cf0211 (diff)
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>
-rw-r--r--test/litest.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/litest.c b/test/litest.c
index 492aa3a..2adec94 100644
--- a/test/litest.c
+++ b/test/litest.c
@@ -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);
}