Show More
@@ -75,9 +75,12 b' def worker(ui, costperarg, func, statica' | |||||
75 | def _posixworker(ui, func, staticargs, args): |
|
75 | def _posixworker(ui, func, staticargs, args): | |
76 | rfd, wfd = os.pipe() |
|
76 | rfd, wfd = os.pipe() | |
77 | workers = _numworkers(ui) |
|
77 | workers = _numworkers(ui) | |
|
78 | oldhandler = signal.getsignal(signal.SIGINT) | |||
|
79 | signal.signal(signal.SIGINT, signal.SIG_IGN) | |||
78 | for pargs in partition(args, workers): |
|
80 | for pargs in partition(args, workers): | |
79 | pid = os.fork() |
|
81 | pid = os.fork() | |
80 | if pid == 0: |
|
82 | if pid == 0: | |
|
83 | signal.signal(signal.SIGINT, oldhandler) | |||
81 | try: |
|
84 | try: | |
82 | os.close(rfd) |
|
85 | os.close(rfd) | |
83 | for i, item in func(*(staticargs + (pargs,))): |
|
86 | for i, item in func(*(staticargs + (pargs,))): | |
@@ -87,8 +90,6 b' def _posixworker(ui, func, staticargs, a' | |||||
87 | os._exit(255) |
|
90 | os._exit(255) | |
88 | os.close(wfd) |
|
91 | os.close(wfd) | |
89 | fp = os.fdopen(rfd, 'rb', 0) |
|
92 | fp = os.fdopen(rfd, 'rb', 0) | |
90 | oldhandler = signal.getsignal(signal.SIGINT) |
|
|||
91 | signal.signal(signal.SIGINT, signal.SIG_IGN) |
|
|||
92 | def cleanup(): |
|
93 | def cleanup(): | |
93 | # python 2.4 is too dumb for try/yield/finally |
|
94 | # python 2.4 is too dumb for try/yield/finally | |
94 | signal.signal(signal.SIGINT, oldhandler) |
|
95 | signal.signal(signal.SIGINT, oldhandler) |
General Comments 0
You need to be logged in to leave comments.
Login now