aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2017-08-03 12:33:40 +0100
committerRon Yorston <rmy@pobox.com>2017-08-03 12:33:40 +0100
commitc3ca46e619744ccd6c597417cc8e373149608909 (patch)
treead00b2085cb7a5f64112f330225a3e776402d4a3
parent8e20d4e9264a30dcc6d652943211668b1a6fe85b (diff)
downloadbusybox-w32-c3ca46e619744ccd6c597417cc8e373149608909.tar.gz
busybox-w32-c3ca46e619744ccd6c597417cc8e373149608909.tar.bz2
busybox-w32-c3ca46e619744ccd6c597417cc8e373149608909.zip
ash: fixes to wait status
Replace W* macros with versions from GNU C library. Change wait status values to match.
-rw-r--r--include/mingw.h6
-rw-r--r--shell/ash.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/include/mingw.h b/include/mingw.h
index 5f1074160..574a77e7c 100644
--- a/include/mingw.h
+++ b/include/mingw.h
@@ -184,10 +184,10 @@ int winansi_get_terminal_width_height(struct winsize *win);
184/* 184/*
185 * stdlib.h 185 * stdlib.h
186 */ 186 */
187#define WIFEXITED(x) ((unsigned)(x) < 259) /* STILL_ACTIVE */
188#define WEXITSTATUS(x) ((x) & 0xff)
189#define WIFSIGNALED(x) ((unsigned)(x) > 259)
190#define WTERMSIG(x) ((x) & 0x7f) 187#define WTERMSIG(x) ((x) & 0x7f)
188#define WIFEXITED(x) (WTERMSIG(x) == 0)
189#define WEXITSTATUS(x) (((x) & 0xff00) >> 8)
190#define WIFSIGNALED(x) (((signed char) (((x) & 0x7f) + 1) >> 1) > 0)
191#define WCOREDUMP(x) 0 191#define WCOREDUMP(x) 0
192 192
193int mingw_system(const char *cmd); 193int mingw_system(const char *cmd);
diff --git a/shell/ash.c b/shell/ash.c
index 18e53a0da..758187ccd 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -4378,14 +4378,14 @@ waitpid_child(int *status, int wait_flags)
4378 pid = pidlist[1]; 4378 pid = pidlist[1];
4379 free(pidlist); 4379 free(pidlist);
4380 free(proclist); 4380 free(proclist);
4381 *status = 260; /* terminated by a signal */ 4381 *status = 128 + SIGINT; /* terminated by a signal */
4382 return pid; 4382 return pid;
4383 } 4383 }
4384 GetExitCodeProcess(proclist[idx], &win_status); 4384 GetExitCodeProcess(proclist[idx], &win_status);
4385 pid = pidlist[idx]; 4385 pid = pidlist[idx];
4386 free(pidlist); 4386 free(pidlist);
4387 free(proclist); 4387 free(proclist);
4388 *status = (int)win_status; 4388 *status = (int)win_status << 8;
4389 return pid; 4389 return pid;
4390} 4390}
4391#define waitpid(p, s, f) waitpid_child(s, f) 4391#define waitpid(p, s, f) waitpid_child(s, f)