From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9GHM-0005x8-Mx for qemu-devel@nongnu.org; Tue, 13 Aug 2013 11:13:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V9GHC-0004FJ-JT for qemu-devel@nongnu.org; Tue, 13 Aug 2013 11:13:00 -0400 Sender: fluxion From: Michael Roth Date: Tue, 13 Aug 2013 10:11:14 -0500 Message-Id: <1376406680-16302-51-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1376406680-16302-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1376406680-16302-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 50/56] ignore SIGPIPE in qemu-img and qemu-io List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, qemu-stable@nongnu.org From: MORITA Kazutaka This prevents the tools from being stopped when they write data to a closed connection in the other side. Signed-off-by: MORITA Kazutaka Reviewed-by: Paolo Bonzini Signed-off-by: Kevin Wolf (cherry picked from commit 526eda14a68d5b3596be715505289b541288ef2a) Signed-off-by: Michael Roth --- qemu-img.c | 4 ++++ qemu-io.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/qemu-img.c b/qemu-img.c index cd096a1..2189fc9 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -2460,6 +2460,10 @@ int main(int argc, char **argv) const img_cmd_t *cmd; const char *cmdname; +#ifdef CONFIG_POSIX + signal(SIGPIPE, SIG_IGN); +#endif + error_set_progname(argv[0]); qemu_init_main_loop(); diff --git a/qemu-io.c b/qemu-io.c index 475a8bd..5045ff8 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -1920,6 +1920,10 @@ int main(int argc, char **argv) int opt_index = 0; int flags = BDRV_O_UNMAP; +#ifdef CONFIG_POSIX + signal(SIGPIPE, SIG_IGN); +#endif + progname = basename(argv[0]); while ((c = getopt_long(argc, argv, sopt, lopt, &opt_index)) != -1) { -- 1.7.9.5