summaryrefslogtreecommitdiff
path: root/udev.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-02-23 19:31:14 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:32:30 -0700
commite41245cb256231ef6954b3cbf45f0635d01501ed (patch)
tree132c1a400dadb4ccc902bcae5e79109178b5cfcc /udev.c
parent82962619c626edfc68d39f0b179a909dd3dd0a6b (diff)
[PATCH] udev - allow all files in a directory as the config
I was on the train for 5 hours today and the TODO is almost empty :) So, at least four people wanted this feature, then here is a actual working patch. We may specify now in udev.conf: udev_rules="/etc/udev/" and udev will scan the whole directory for files ending with *.rules, sort it in lexical order and create our rule list from all of the files. A plain given file will still work and the same applies to the *.permissions. I sort the files in our usual linked list, cause klibc has no scandir().
Diffstat (limited to 'udev.c')
-rw-r--r--udev.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/udev.c b/udev.c
index 8c91ac62d4..1c65f2e59c 100644
--- a/udev.c
+++ b/udev.c
@@ -111,13 +111,13 @@ static int udev_hotplug(int argc, char **argv)
action = get_action();
if (!action) {
- dbg ("no action?");
+ dbg("no action?");
goto exit;
}
devpath = get_devpath();
if (!devpath) {
- dbg ("no devpath?");
+ dbg("no devpath?");
goto exit;
}
dbg("looking at '%s'", devpath);
@@ -131,6 +131,10 @@ static int udev_hotplug(int argc, char **argv)
/* skip blacklisted subsystems */
subsystem = argv[1];
+ if (!subsystem) {
+ dbg("no subsystem?");
+ goto exit;
+ }
i = 0;
while (subsystem_blacklist[i][0] != '\0') {
if (strcmp(subsystem, subsystem_blacklist[i]) == 0) {