summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-11-23 06:22:26 +0100
committerGreg KH <gregkh@suse.de>2005-04-26 22:35:00 -0700
commit491b02acd95904f17829f792c5a69c26bee1f2a7 (patch)
tree45498b6d0ce26b89e7564d802dfbe089f664dc3d
parent6f59ed5547426ddaf6bedf574d19a19f6bd20e1f (diff)
[PATCH] make the searched multiplex directories conditionally
If we don't have "name" or a "subsystem" don't look for it.
-rw-r--r--dev_d.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/dev_d.c b/dev_d.c
index d14c70c256..817355af60 100644
--- 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';