summaryrefslogtreecommitdiff
path: root/test-udev.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2008-04-21 19:00:54 +0200
committerKay Sievers <kay.sievers@vrfy.org>2008-04-21 19:00:54 +0200
commitbf50425b58da6f112197f79241dd6d64af2e9ea7 (patch)
tree2e3f961beaff4d62404ae9191c4c8a996f608cbc /test-udev.c
parent6b795c99e00c92dd29abafcc1022cace7bbcb795 (diff)
add OPTIONS+="event_timeout=<seconds>"
Diffstat (limited to 'test-udev.c')
-rw-r--r--test-udev.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/test-udev.c b/test-udev.c
index e341b74f2f..4ac2d5a889 100644
--- a/test-udev.c
+++ b/test-udev.c
@@ -105,7 +105,7 @@ int main(int argc, char *argv[], char *envp[])
sigaction(SIGTERM, &act, NULL);
/* trigger timeout to prevent hanging processes */
- alarm(UDEV_ALARM_TIMEOUT);
+ alarm(UDEV_EVENT_TIMEOUT);
action = getenv("ACTION");
devpath = getenv("DEVPATH");
@@ -154,6 +154,10 @@ int main(int argc, char *argv[], char *envp[])
retval = udev_device_event(&rules, udev);
+ /* rules may change/disable the timeout */
+ if (udev->event_timeout >= 0)
+ alarm(udev->event_timeout);
+
if (retval == 0 && !udev->ignore_device && udev_run)
udev_rules_run(udev);