[adm5120] fix image generation for the ZyXEL boards
[openwrt/svn-archive/archive.git] / package / hotplug2 / patches / 100-rules_override.patch
1 Index: hotplug2-0.9/hotplug2.c
2 ===================================================================
3 --- hotplug2-0.9.orig/hotplug2.c 2007-06-04 13:21:41.134723240 +0200
4 +++ hotplug2-0.9/hotplug2.c 2007-06-04 13:21:41.203712752 +0200
5 @@ -391,6 +391,7 @@
6 int rv = 0;
7 int i;
8 char *coldplug_command = NULL;
9 + char *rules_file = HOTPLUG2_RULE_PATH;
10 sigset_t block_mask;
11
12 struct rules_t *rules = NULL;
13 @@ -435,6 +436,13 @@
14 break;
15
16 modprobe_command = *argv;
17 + } else if (!strcmp(*argv, "--set-rules-file")) {
18 + argv++;
19 + argc--;
20 + if (argc <= 0)
21 + break;
22 +
23 + rules_file = *argv;
24 }
25 }
26 }
27 @@ -443,7 +451,7 @@
28 #ifdef HAVE_RULES
29 if (!dumb) {
30 filemap = MAP_FAILED;
31 - rule_fd = open(HOTPLUG2_RULE_PATH, O_RDONLY | O_NOATIME);
32 + rule_fd = open(rules_file, O_RDONLY | O_NOATIME);
33 if (rule_fd == -1) {
34 dumb = 1;
35 ERROR("rules parse","Unable to open rules file: %s.", strerror(errno));