Skip to content

Commit

Permalink
ceph.in:avoid a broken pipe error when use ceph command
Browse files Browse the repository at this point in the history
Fixes: ceph#14354
Signed-off-by: Bo Cai <[email protected]>
  • Loading branch information
charpty committed Jan 14, 2016
1 parent 92d3d17 commit f6eb3e5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/ceph.in
Original file line number Diff line number Diff line change
Expand Up @@ -917,10 +917,14 @@ def main():
if suffix != '':
outbuf = outbuf.rstrip()
if outbuf != '':
# Write directly to binary stdout
raw_stdout.write(prefix)
raw_stdout.write(outbuf)
raw_stdout.write(suffix)
try:
# Write directly to binary stdout
raw_stdout.write(prefix)
raw_stdout.write(outbuf)
raw_stdout.write(suffix)
except IOError as e:
if e.errno != errno.EPIPE:
raise e

sys.stdout.flush()

Expand Down

0 comments on commit f6eb3e5

Please sign in to comment.