summaryrefslogtreecommitdiff
path: root/udev_multiplex.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2005-03-29 11:25:52 +0200
committerGreg KH <gregkh@suse.de>2005-04-26 23:55:00 -0700
commitfb39f0566e248c09772ed15a3218ef2381700b6a (patch)
treea4c9599e64e6e0a635314ac4faf77625752338ef /udev_multiplex.c
parent7ff56624f84d1616470ab6cbeab17c1367e775d7 (diff)
[PATCH] move execute_program to utils + add action to init_device
Diffstat (limited to 'udev_multiplex.c')
-rw-r--r--udev_multiplex.c34
1 files changed, 1 insertions, 33 deletions
diff --git a/udev_multiplex.c b/udev_multiplex.c
index 9ab11e6bea..22bbaf7b61 100644
--- a/udev_multiplex.c
+++ b/udev_multiplex.c
@@ -32,38 +32,6 @@
#include "udev_utils.h"
#include "logging.h"
-static int run_program(struct udevice *udev, const char *filename)
-{
- pid_t pid;
- int fd;
-
- dbg("running %s", filename);
-
- pid = fork();
- switch (pid) {
- case 0:
- /* child */
- fd = open("/dev/null", O_RDWR);
- if ( fd >= 0) {
- dup2(fd, STDOUT_FILENO);
- dup2(fd, STDIN_FILENO);
- dup2(fd, STDERR_FILENO);
- }
- close(fd);
-
- execl(filename, filename, udev->subsystem, NULL);
- dbg("exec of child failed");
- _exit(1);
- case -1:
- dbg("fork of child failed");
- break;
- return -1;
- default:
- waitpid(pid, NULL, 0);
- }
-
- return 0;
-}
/*
* runs files in these directories in order:
@@ -117,7 +85,7 @@ void udev_multiplex_directory(struct udevice *udev, const char *basedir, const c
add_matching_files(&name_list, dirname, suffix);
list_for_each_entry_safe(name_loop, name_tmp, &name_list, node) {
- run_program(udev, name_loop->name);
+ execute_command(name_loop->name, udev->subsystem);
list_del(&name_loop->node);
}