Skip to content

Commit 894e546

Browse files
author
Andy C
committed
[fix] W1_OK shouldn't be 0.
W1_OK and W1_ECHILD shouldn't overlap with the range of valid signals. sig_num == 0 is technically not valid, but I'm working on it. SigwinchHandler doesn't set it if self.user_handler isn't set. Fixes spec/oil-xtrace.
1 parent 37d5600 commit 894e546

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

core/process.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1355,8 +1355,8 @@ def NoneAreRunning(self):
13551355

13561356
# WaitForOne() return values
13571357

1358-
W1_OK = 0 # waitpid(-1) returned
1359-
W1_ECHILD = -1 # no processes to wait for
1358+
W1_OK = -2 # waitpid(-1) returned
1359+
W1_ECHILD = -3 # no processes to wait for
13601360
# result > 0: # a signal number that we exited with!
13611361

13621362

osh/builtin_process.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ def _Run(self, cmd_val):
168168
# Not sure it matters since you can now Ctrl-C it.
169169

170170
result = self.waiter.WaitForOne()
171-
if result == process.W1_ECHILD: # nothing to wait for, or interrupted. status is 0
171+
if result == process.W1_ECHILD:
172+
# nothing to wait for, or interrupted. status is 0
172173
break
173174
elif result >= 0: # signal
174175
status = 128 + result

0 commit comments

Comments
 (0)