summaryrefslogtreecommitdiff
path: root/src/udev/udev-rules.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-09-11 18:49:04 +0200
committerTom Gundersen <teg@jklm.no>2014-09-11 23:45:01 +0200
commit671174136525ddf208cdbe75d6d6bd159afa961f (patch)
treed320e6f6f180c05be42c5201d34abcc40c52776c /src/udev/udev-rules.c
parente926f6475d2f7063f8190076a0dc9ff7ecb227c8 (diff)
udev: timeout - warn after a third of the timeout before killing
Diffstat (limited to 'src/udev/udev-rules.c')
-rw-r--r--src/udev/udev-rules.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
index 9514dde751..db95442fda 100644
--- a/src/udev/udev-rules.c
+++ b/src/udev/udev-rules.c
@@ -615,6 +615,7 @@ static int import_file_into_properties(struct udev_device *dev, const char *file
static int import_program_into_properties(struct udev_event *event,
usec_t timeout_usec,
+ usec_t timeout_warn_usec,
const char *program, const sigset_t *sigmask) {
struct udev_device *dev = event->dev;
char **envp;
@@ -623,7 +624,7 @@ static int import_program_into_properties(struct udev_event *event,
int err;
envp = udev_device_get_properties_envp(dev);
- err = udev_event_spawn(event, timeout_usec, program, envp, sigmask, result, sizeof(result));
+ err = udev_event_spawn(event, timeout_usec, timeout_warn_usec, program, envp, sigmask, result, sizeof(result));
if (err < 0)
return err;
@@ -1862,6 +1863,7 @@ enum escape_type {
int udev_rules_apply_to_event(struct udev_rules *rules,
struct udev_event *event,
usec_t timeout_usec,
+ usec_t timeout_warn_usec,
const sigset_t *sigmask) {
struct token *cur;
struct token *rule;
@@ -2070,7 +2072,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules,
rules_str(rules, rule->rule.filename_off),
rule->rule.filename_line);
- if (udev_event_spawn(event, timeout_usec, program, envp, sigmask, result, sizeof(result)) < 0) {
+ if (udev_event_spawn(event, timeout_usec, timeout_warn_usec, program, envp, sigmask, result, sizeof(result)) < 0) {
if (cur->key.op != OP_NOMATCH)
goto nomatch;
} else {
@@ -2106,7 +2108,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules,
rules_str(rules, rule->rule.filename_off),
rule->rule.filename_line);
- if (import_program_into_properties(event, timeout_usec, import, sigmask) != 0)
+ if (import_program_into_properties(event, timeout_usec, timeout_warn_usec, import, sigmask) != 0)
if (cur->key.op != OP_NOMATCH)
goto nomatch;
break;