From e41245cb256231ef6954b3cbf45f0635d01501ed Mon Sep 17 00:00:00 2001 From: "kay.sievers@vrfy.org" Date: Mon, 23 Feb 2004 19:31:14 -0800 Subject: [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(). --- udev.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'udev.c') diff --git a/udev.c b/udev.c index 8c91ac62..1c65f2e5 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) { -- cgit 1.2.3-korg