diff options
author | Steve Bennett <steveb@workware.net.au> | 2022-05-08 15:18:17 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2022-05-08 15:45:27 +1000 |
commit | 7f75234e8e68394271ecb8b56a0a117a1d6066a7 (patch) | |
tree | c8df7ddccb3fb78b67c19c40e349173e571ba72e /jim-exec.c | |
parent | 8bcdb359a0c7217dfebc73c61037a005bb65717d (diff) | |
download | jimtcl-7f75234e8e68394271ecb8b56a0a117a1d6066a7.zip jimtcl-7f75234e8e68394271ecb8b56a0a117a1d6066a7.tar.gz jimtcl-7f75234e8e68394271ecb8b56a0a117a1d6066a7.tar.bz2 |
wait: fix support for wait -1
Only on unix systems. Does waitpid(-1, ...) to wait for any child
process to exit.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim-exec.c')
-rw-r--r-- | jim-exec.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -614,6 +614,12 @@ static int Jim_WaitCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv) if (phandle == JIM_BAD_PHANDLE) { pid = -1; } + else if (pid < 0) { + /* This catches the case where pid=-1. It is only supported on unix where + * the returned phandle is a pid, so can simply assign here + */ + pid = phandle; + } errCodeObj = JimMakeErrorCode(interp, pid, status, NULL); |