diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2016-11-10 13:46:13 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-11-11 11:12:37 -0500 |
commit | eef06b82f16c78dc0197e3e9d5b2230647a890ff (patch) | |
tree | 23149da3c276a2d1719d7d4aa73aedf47c58fa79 | |
parent | 9956edf37e65e93fbb76dcff1236dff2323d306a (diff) |
scripts/bloat-o-meter: fix SIGPIPE
Fix piping output to a program which quickly exits (read: head -n1)
$ ./scripts/bloat-o-meter ../vmlinux-000 ../obj/vmlinux | head -n1
add/remove: 0/0 grow/shrink: 9/60 up/down: 124/-305 (-181)
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr
Link: http://lkml.kernel.org/r/20161028204618.GA29923@avx2
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Matt Mackall <mpm@selenic.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rwxr-xr-x | scripts/bloat-o-meter | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/bloat-o-meter b/scripts/bloat-o-meter index 19f5adfd877d..d9ff038c1b28 100755 --- a/scripts/bloat-o-meter +++ b/scripts/bloat-o-meter | |||
@@ -8,6 +8,9 @@ | |||
8 | # of the GNU General Public License, incorporated herein by reference. | 8 | # of the GNU General Public License, incorporated herein by reference. |
9 | 9 | ||
10 | import sys, os, re | 10 | import sys, os, re |
11 | from signal import signal, SIGPIPE, SIG_DFL | ||
12 | |||
13 | signal(SIGPIPE, SIG_DFL) | ||
11 | 14 | ||
12 | if len(sys.argv) != 3: | 15 | if len(sys.argv) != 3: |
13 | sys.stderr.write("usage: %s file1 file2\n" % sys.argv[0]) | 16 | sys.stderr.write("usage: %s file1 file2\n" % sys.argv[0]) |