diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-22 10:49:08 +1000 |
---|---|---|
committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-22 10:49:08 +1000 |
commit | 5c4eb803c62b9199eeab3bd2c72bd931eab10960 (patch) | |
tree | 70087112f6dd40447226c88f118366b61701d1fe /shell | |
parent | 6e1050c254353471131672c0e8383c9e906d6fb5 (diff) | |
download | busybox-w32-5c4eb803c62b9199eeab3bd2c72bd931eab10960.tar.gz busybox-w32-5c4eb803c62b9199eeab3bd2c72bd931eab10960.tar.bz2 busybox-w32-5c4eb803c62b9199eeab3bd2c72bd931eab10960.zip |
win32: ash: make waitpid return early if there is no child
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c index 0ff5adb04..c3b497938 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -4079,6 +4079,8 @@ waitpid_child(int *status) | |||
4079 | } | 4079 | } |
4080 | 4080 | ||
4081 | LOOP(pid_nr++); | 4081 | LOOP(pid_nr++); |
4082 | if (!pid_nr) | ||
4083 | return -1; | ||
4082 | pidp = pidlist = ckmalloc(sizeof(*pidlist)*pid_nr); | 4084 | pidp = pidlist = ckmalloc(sizeof(*pidlist)*pid_nr); |
4083 | LOOP(*pidp++ = (HANDLE)ps->ps_pid); | 4085 | LOOP(*pidp++ = (HANDLE)ps->ps_pid); |
4084 | #undef LOOP | 4086 | #undef LOOP |