1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-22 06:50:18 +03:00

[PATCH] fix UDEV_NO_SLEEP

Move setting UDEV_NO_SLEEP into main().  I thought about moving
udev_init_config() around, but it still must be invoked in both udev and
udevstart cases, and before udev_hotplug() is called.  An alternative
would be to have main() do:
if (is_udevstart) {
	... current ...
} else {
	udev_init_config();
	return udev_hotplug();
}

And move setting UDEV_NO_SLEEP into udev_start().  I can redo it that
way, if you prefer.

Signed-off-by: Tom Rini <trini@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
This commit is contained in:
trini@kernel.crashing.org 2004-08-11 01:02:59 -07:00 committed by Greg KH
parent a4f5eb034b
commit 2410242aa4
2 changed files with 4 additions and 4 deletions

5
udev.c
View File

@ -174,8 +174,11 @@ int main(int argc, char *argv[], char *envp[])
main_argv = argv;
main_envp = envp;
if (strstr(argv[0], "udevstart"))
if (strstr(argv[0], "udevstart")) {
/* Setup env variables. */
setenv("UDEV_NO_SLEEP", "1", 1);
is_udevstart = 1;
}
/* initialize our configuration */
udev_init_config();

View File

@ -75,9 +75,6 @@ static int device_list_insert(char *path, char *subsystem, struct list_head *dev
static void udev_exec(const char *path, const char* subsystem)
{
/* Setup env variables. */
setenv("UDEV_NO_SLEEP", "1", 1);
/* Now call __udev_hotplug(). */
if (__udev_hotplug("add", path, subsystem)) {
dbg("Calling of udev_hotplug failed");