redo-ifchange: return nonzero if one of the dependencies fails to build.
Oops! We were just always returning 0 (success) in that case.
This commit is contained in:
parent
6b0da1fda0
commit
840a8da1ef
2 changed files with 5 additions and 1 deletions
4
jwack.py
4
jwack.py
|
|
@ -95,11 +95,13 @@ def wait(want_token):
|
|||
del _waitfds[fd]
|
||||
rv = os.waitpid(pd.pid, 0)
|
||||
assert(rv[0] == pd.pid)
|
||||
_debug("done1: rv=%r\n" % (rv,))
|
||||
rv = rv[1]
|
||||
if os.WIFEXITED(rv):
|
||||
pd.rv = os.WEXITSTATUS(rv)
|
||||
else:
|
||||
pd.rv = -os.WTERMSIG(rv)
|
||||
_debug("done2: rv=%d\n" % pd.rv)
|
||||
pd.donefunc(pd.name, pd.rv)
|
||||
|
||||
|
||||
|
|
@ -187,11 +189,13 @@ def start_job(reason, lock, jobfunc, donefunc):
|
|||
try:
|
||||
try:
|
||||
rv = jobfunc() or 0
|
||||
_debug('jobfunc completed (%r, %r)\n' % (jobfunc,rv))
|
||||
except Exception:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
lock.unlock()
|
||||
finally:
|
||||
_debug('exit: %d\n' % rv)
|
||||
os._exit(rv)
|
||||
# else we're the parent process
|
||||
lock.owned = False # child owns it now
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue