1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
3 # Test suite for GNU tar.
4 # Copyright (C) 2010 Free Software Foundation, Inc.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3, or (at your option)
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 AT_SETUP([sigpipe handling])
20 AT_KEYWORDS([sigpipe])
22 # Description: Tar 1.23 ignored sigpipe which lead to spurious "write
23 # error" diagnostics when piping output to another programs.
24 # Reported-by: "Dmitry V. Levin" <ldv@altlinux.org>
25 # References: http://lists.gnu.org/archive/html/bug-tar/2010-03/msg00039.html
26 # <20100319184141.GC30047@wo.int.altlinux.org>
31 genfile --length 2048 --file first
32 genfile --length 2048 --file second
33 genfile --length 2049 --file third
35 tar cf archive first second third
37 # Discard diagnostics that some shells generate about broken pipes.
38 (tar tf archive 2>&3 | :) 3>&2 2>/dev/null