##// END OF EJS Templates
hook: ignore EPIPE when flushing stdout/stderr...
Mitchell Plamann -
r46329:b3e8d8e4 default
parent child Browse files
Show More
@@ -8,6 +8,7 b''
8 8 from __future__ import absolute_import
9 9
10 10 import contextlib
11 import errno
11 12 import os
12 13 import sys
13 14
@@ -289,10 +290,18 b' def redirect_stdio():'
289 290 # The stderr is fully buffered on Windows when connected to a pipe.
290 291 # A forcible flush is required to make small stderr data in the
291 292 # remote side available to the client immediately.
293 try:
292 294 procutil.stderr.flush()
295 except IOError as err:
296 if err.errno not in (errno.EPIPE, errno.EIO, errno.EBADF):
297 raise error.StdioError(err)
293 298
294 299 if _redirect and oldstdout >= 0:
300 try:
295 301 procutil.stdout.flush() # write hook output to stderr fd
302 except IOError as err:
303 if err.errno not in (errno.EPIPE, errno.EIO, errno.EBADF):
304 raise error.StdioError(err)
296 305 os.dup2(oldstdout, stdoutno)
297 306 os.close(oldstdout)
298 307
@@ -64,4 +64,4 b' disconnecting. Then exit nonzero, to for'
64 64 abort: stream ended unexpectedly (got 0 bytes, expected 4)
65 65
66 66 $ check_for_abandoned_transaction
67 Abandoned transaction!
67 [1]
General Comments 0
You need to be logged in to leave comments. Login now