Show More
@@ -115,11 +115,17 b' def _posixworker(ui, func, staticargs, a' | |||||
115 | st = _exitstatus(st) |
|
115 | st = _exitstatus(st) | |
116 | if st and not problem[0]: |
|
116 | if st and not problem[0]: | |
117 | problem[0] = st |
|
117 | problem[0] = st | |
|
118 | # unregister SIGCHLD handler as all children will be killed | |||
|
119 | signal.signal(signal.SIGCHLD, oldchldhandler) | |||
118 | killworkers() |
|
120 | killworkers() | |
|
121 | def sigchldhandler(signum, frame): | |||
|
122 | waitforworkers(blocking=False) | |||
|
123 | oldchldhandler = signal.signal(signal.SIGCHLD, sigchldhandler) | |||
119 | for pargs in partition(args, workers): |
|
124 | for pargs in partition(args, workers): | |
120 | pid = os.fork() |
|
125 | pid = os.fork() | |
121 | if pid == 0: |
|
126 | if pid == 0: | |
122 | signal.signal(signal.SIGINT, oldhandler) |
|
127 | signal.signal(signal.SIGINT, oldhandler) | |
|
128 | signal.signal(signal.SIGCHLD, oldchldhandler) | |||
123 | try: |
|
129 | try: | |
124 | os.close(rfd) |
|
130 | os.close(rfd) | |
125 | for i, item in func(*(staticargs + (pargs,))): |
|
131 | for i, item in func(*(staticargs + (pargs,))): | |
@@ -137,6 +143,7 b' def _posixworker(ui, func, staticargs, a' | |||||
137 | def cleanup(): |
|
143 | def cleanup(): | |
138 | signal.signal(signal.SIGINT, oldhandler) |
|
144 | signal.signal(signal.SIGINT, oldhandler) | |
139 | t.join() |
|
145 | t.join() | |
|
146 | signal.signal(signal.SIGCHLD, oldchldhandler) | |||
140 | status = problem[0] |
|
147 | status = problem[0] | |
141 | if status: |
|
148 | if status: | |
142 | if status < 0: |
|
149 | if status < 0: |
General Comments 0
You need to be logged in to leave comments.
Login now