From: Guillaume Chazarain Date: Sun, 22 Jan 2012 20:36:22 +0000 (+0100) Subject: Restore the default SIGPIPE handler X-Git-Tag: iotop-0.6~34 X-Git-Url: https://repo.or.cz/w/iotop.git/commitdiff_plain/850274be1d257f4063feec735aff89fdb7d099ea Restore the default SIGPIPE handler so that sudo ./iotop.py -b|head does what's expected. --- diff --git a/iotop/ui.py b/iotop/ui.py index 6c4ffa1..3292310 100644 --- a/iotop/ui.py +++ b/iotop/ui.py @@ -23,6 +23,7 @@ import math import optparse import os import select +import signal import sys import time @@ -465,6 +466,8 @@ class IOTopUI(object): self.win.refresh() def run_iotop_window(win, options): + if options.batch: + signal.signal(signal.SIGPIPE, signal.SIG_DFL) taskstats_connection = TaskStatsNetlink(options) process_list = ProcessList(taskstats_connection, options) ui = IOTopUI(win, process_list, options)