summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-09-22 09:47:27 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2015-09-22 10:27:39 +0200
commit955731f6ce15763db1a0139c64f3854753e5dd05 (patch)
tree7fc36273a2406d51d00a8ffd6203b0e35149ee97
parentfb806cd3ce7611035b6f9dfa40c98359c320d6f2 (diff)
downloadnlplug-955731f6ce15763db1a0139c64f3854753e5dd05.tar.bz2
nlplug-955731f6ce15763db1a0139c64f3854753e5dd05.tar.xz
nlplug: do not require a handler program
devtmpfs will create the device node. in initramfs situation we may not bother about permissions etc.
-rw-r--r--nlplug.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/nlplug.c b/nlplug.c
index a282321..f53cac9 100644
--- a/nlplug.c
+++ b/nlplug.c
@@ -219,8 +219,10 @@ int dispatch_uevent(struct uevent *ev, struct ueventconf *conf)
conf->modalias_count++;
} else if (ev->devname != NULL) {
- run_child(conf->program_argv);
- conf->fork_count++;
+ if (conf->program_argv[0] != NULL) {
+ run_child(conf->program_argv);
+ conf->fork_count++;
+ }
if (ev->subsystem && strcmp(ev->subsystem, "block") == 0
&& strcmp(ev->action, "add") == 0
@@ -328,9 +330,6 @@ int main(int argc, char *argv[])
usage();
} ARGEND;
- if (argv[0] == NULL)
- usage();
-
conf.program_argv = argv;
chdir("/dev");