From patchwork Tue Jul 23 08:30:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: MORITA Kazutaka X-Patchwork-Id: 260985 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id AC0AF2C0095 for ; Tue, 23 Jul 2013 18:36:27 +1000 (EST) Received: from localhost ([::1]:34132 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1Y53-0004i1-ET for incoming@patchwork.ozlabs.org; Tue, 23 Jul 2013 04:36:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53832) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1Y0E-00051Q-JG for qemu-devel@nongnu.org; Tue, 23 Jul 2013 04:31:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V1Y0C-0001gY-Su for qemu-devel@nongnu.org; Tue, 23 Jul 2013 04:31:26 -0400 Received: from sh.osrg.net ([192.16.179.4]:37885) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1Y0C-0001gH-Ct for qemu-devel@nongnu.org; Tue, 23 Jul 2013 04:31:24 -0400 Received: from fs.osrg.net (localns.osrg.net [10.0.0.11]) by sh.osrg.net (8.14.4/8.14.4/OSRG-NET) with ESMTP id r6N8V7wZ010554; Tue, 23 Jul 2013 17:31:07 +0900 Received: from localhost (unknown [10.32.32.72]) by fs.osrg.net (Postfix) with ESMTP id 398D2F948; Tue, 23 Jul 2013 17:31:07 +0900 (JST) From: MORITA Kazutaka To: Kevin Wolf , Stefan Hajnoczi , qemu-devel@nongnu.org Date: Tue, 23 Jul 2013 17:30:11 +0900 Message-Id: <1374568221-23147-2-git-send-email-morita.kazutaka@lab.ntt.co.jp> X-Mailer: git-send-email 1.8.1.3.566.gaa39828 In-Reply-To: <1374568221-23147-1-git-send-email-morita.kazutaka@lab.ntt.co.jp> References: <1374568221-23147-1-git-send-email-morita.kazutaka@lab.ntt.co.jp> X-Dispatcher: imput version 20100215(IM150) Lines: 42 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (sh.osrg.net [192.16.179.4]); Tue, 23 Jul 2013 17:31:08 +0900 (JST) X-Virus-Scanned: clamav-milter 0.97.8 at sh X-Virus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 192.16.179.4 Cc: sheepdog@lists.wpkg.org Subject: [Qemu-devel] [PATCH 01/11] ignore SIGPIPE in qemu-img and qemu-io X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- qemu-img.c | 4 ++++ qemu-io.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/qemu-img.c b/qemu-img.c index c55ca5c..919d464 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -2319,6 +2319,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) {