[PATCH 1/2] udevd: respect the value of TIMEOUT in uevents

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I believe this is the correct behaviour.  I'm highlighting this change
by making it a separate commit (even though the specific code will be
removed in the following commit).

Signed-off-by: Alan Jenkins <alan-jenkins@xxxxxxxxxxxxxx>

diff --git a/udev/test-udev.c b/udev/test-udev.c
index c6b8bf5..35737c1 100644
--- a/udev/test-udev.c
+++ b/udev/test-udev.c
@@ -70,7 +70,10 @@ int main(int argc, char *argv[])
 	sigaction(SIGTERM, &act, NULL);
 
 	/* trigger timeout to prevent hanging processes */
-	alarm(UDEV_EVENT_TIMEOUT);
+	if (udev_device_get_timeout(event->dev) > 0)
+		alarm(udev_device_get_timeout(event->dev));
+	else
+		alarm(UDEV_EVENT_TIMEOUT);
 
 	action = getenv("ACTION");
 	devpath = getenv("DEVPATH");
diff --git a/udev/udevd.c b/udev/udevd.c
index 5ee61d2..03ea26d 100644
--- a/udev/udevd.c
+++ b/udev/udevd.c
@@ -156,7 +156,10 @@ static void event_fork(struct udev_event *event)
 		sigaction(SIGHUP, &act, NULL);
 
 		/* set timeout to prevent hanging processes */
-		alarm(UDEV_EVENT_TIMEOUT);
+		if (udev_device_get_timeout(event->dev) > 0)
+			alarm(udev_device_get_timeout(event->dev));
+		else
+			alarm(UDEV_EVENT_TIMEOUT);
 
 		/* apply rules, create node, symlinks */
 		err = udev_event_execute_rules(event, rules);


--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux