From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6iQe-0002kQ-3a for qemu-devel@nongnu.org; Tue, 06 Aug 2013 10:40:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V6iQY-0002UD-EH for qemu-devel@nongnu.org; Tue, 06 Aug 2013 10:40:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16818) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6iQY-0002Tw-6z for qemu-devel@nongnu.org; Tue, 06 Aug 2013 10:39:58 -0400 From: Kevin Wolf Date: Tue, 6 Aug 2013 16:39:38 +0200 Message-Id: <1375799990-995-3-git-send-email-kwolf@redhat.com> In-Reply-To: <1375799990-995-1-git-send-email-kwolf@redhat.com> References: <1375799990-995-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL 02/14] ignore SIGPIPE in qemu-img and qemu-io List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@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 --- qemu-img.c | 4 ++++ qemu-io.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/qemu-img.c b/qemu-img.c index dece1b3..b9a848d 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -2322,6 +2322,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 cb9def5..d54dc86 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -335,6 +335,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.8.1.4