diff options
author | bug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2002-11-21 22:17:11 +0000 |
---|---|---|
committer | bug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2002-11-21 22:17:11 +0000 |
commit | 90910b7db8fb4db767102aaff184a8d11d86d1c6 (patch) | |
tree | a5283e7e3560b1f1b4b721eccec1a0b25943be67 /libbb | |
parent | 2bc4cf710fa0eeb21e866ed905b6a02450ad7bf5 (diff) | |
download | busybox-w32-90910b7db8fb4db767102aaff184a8d11d86d1c6.tar.gz busybox-w32-90910b7db8fb4db767102aaff184a8d11d86d1c6.tar.bz2 busybox-w32-90910b7db8fb4db767102aaff184a8d11d86d1c6.zip |
Fix a vfork bug, by Nick Fedchik and Vladimir N. Oleynik
git-svn-id: svn://busybox.net/trunk/busybox@5997 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/run_parts.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libbb/run_parts.c b/libbb/run_parts.c index 8399a6afb..6df51a14e 100644 --- a/libbb/run_parts.c +++ b/libbb/run_parts.c | |||
@@ -50,6 +50,7 @@ extern int run_parts(char **args, const unsigned char test_mode) | |||
50 | struct dirent **namelist = 0; | 50 | struct dirent **namelist = 0; |
51 | struct stat st; | 51 | struct stat st; |
52 | char *filename; | 52 | char *filename; |
53 | char *arg0 = args[0]; | ||
53 | int entries; | 54 | int entries; |
54 | int i; | 55 | int i; |
55 | int exitstatus = 0; | 56 | int exitstatus = 0; |
@@ -60,15 +61,15 @@ extern int run_parts(char **args, const unsigned char test_mode) | |||
60 | (void) &exitstatus; | 61 | (void) &exitstatus; |
61 | #endif | 62 | #endif |
62 | /* scandir() isn't POSIX, but it makes things easy. */ | 63 | /* scandir() isn't POSIX, but it makes things easy. */ |
63 | entries = scandir(args[0], &namelist, valid_name, alphasort); | 64 | entries = scandir(arg0, &namelist, valid_name, alphasort); |
64 | 65 | ||
65 | if (entries == -1) { | 66 | if (entries == -1) { |
66 | perror_msg_and_die("failed to open directory %s", args[0]); | 67 | perror_msg_and_die("failed to open directory %s", arg0); |
67 | } | 68 | } |
68 | 69 | ||
69 | for (i = 0; i < entries; i++) { | 70 | for (i = 0; i < entries; i++) { |
70 | 71 | ||
71 | filename = concat_path_file(args[0], namelist[i]->d_name); | 72 | filename = concat_path_file(arg0, namelist[i]->d_name); |
72 | 73 | ||
73 | if (stat(filename, &st) < 0) { | 74 | if (stat(filename, &st) < 0) { |
74 | perror_msg_and_die("failed to stat component %s", filename); | 75 | perror_msg_and_die("failed to stat component %s", filename); |