search for: execute_dir

Displaying 1 result from an estimated 1 matches for "execute_dir".

Did you mean: execute_bin
2004 Feb 27
0
hotplug for klibc utils
...g") != 0) + return; + + pid = fork(); + + if (pid < 0) { + perror("fork"); + return; + } + + if (pid > 0){ + wait(NULL); + return; + } + + execlp(name, name, parm, NULL); + exit(1); +} + +/* + * enters the given directory and execute the *.hotplug files + */ +static void execute_dir (char *dirname, char *parm) +{ + DIR *directory; + struct dirent *entry; + char filename[256]; + + directory = opendir(dirname); + if (!directory) + return; + + while ((entry = readdir(directory))) { + snprintf(filename, sizeof (filename), + "%s%s", dirname, entry->d_name); + fil...