]> err.no Git - systemd/commitdiff
[PATCH] make the searched multiplex directories conditionally
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>
Tue, 23 Nov 2004 05:22:26 +0000 (06:22 +0100)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 05:35:00 +0000 (22:35 -0700)
If we don't have "name" or a "subsystem" don't look for it.

dev_d.c

diff --git a/dev_d.c b/dev_d.c
index d14c70c256d31a526e5f42b61d490eb61a94f632..817355af60397c4c4f221a793c860d0b0f859ecd 100644 (file)
--- a/dev_d.c
+++ b/dev_d.c
@@ -96,13 +96,17 @@ void dev_d_execute(struct udevice *udev, const char *basedir, const char *suffix
                temp = strchr(temp, '/');
        }
 
-       snprintf(dirname, PATH_MAX, "%s/%s", basedir, udev->name);
-       dirname[PATH_MAX-1] = '\0';
-       call_foreach_file(run_program, dirname, suffix, udev);
+       if (udev->name[0] != '\0') {
+               snprintf(dirname, PATH_MAX, "%s/%s", basedir, udev->name);
+               dirname[PATH_MAX-1] = '\0';
+               call_foreach_file(run_program, dirname, suffix, udev);
+       }
 
-       snprintf(dirname, PATH_MAX, "%s/%s", basedir, udev->subsystem);
-       dirname[PATH_MAX-1] = '\0';
-       call_foreach_file(run_program, dirname, suffix, udev);
+       if (udev->subsystem[0] != '\0') {
+               snprintf(dirname, PATH_MAX, "%s/%s", basedir, udev->subsystem);
+               dirname[PATH_MAX-1] = '\0';
+               call_foreach_file(run_program, dirname, suffix, udev);
+       }
 
        snprintf(dirname, PATH_MAX, "%s/default", basedir);
        dirname[PATH_MAX-1] = '\0';