From patchwork Wed Jul 24 07:56:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: MORITA Kazutaka X-Patchwork-Id: 261331 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 6D1312C008C for ; Wed, 24 Jul 2013 18:06:06 +1000 (EST) Received: from localhost ([::1]:56382 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1u5E-00037y-AV for incoming@patchwork.ozlabs.org; Wed, 24 Jul 2013 04:06:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1ty3-0000R3-9Q for qemu-devel@nongnu.org; Wed, 24 Jul 2013 03:58:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V1ty1-0000eP-Ox for qemu-devel@nongnu.org; Wed, 24 Jul 2013 03:58:39 -0400 Received: from sh.osrg.net ([192.16.179.4]:38792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1ty1-0000dt-7m for qemu-devel@nongnu.org; Wed, 24 Jul 2013 03:58:37 -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 r6O7wPa2014931; Wed, 24 Jul 2013 16:58:25 +0900 Received: from localhost (unknown [10.32.32.72]) by fs.osrg.net (Postfix) with ESMTP id 1DAF3F948; Wed, 24 Jul 2013 16:58:25 +0900 (JST) From: MORITA Kazutaka To: Kevin Wolf , Stefan Hajnoczi , Paolo Bonzini , qemu-devel@nongnu.org Date: Wed, 24 Jul 2013 16:56:25 +0900 Message-Id: <1374652593-7242-2-git-send-email-morita.kazutaka@lab.ntt.co.jp> X-Mailer: git-send-email 1.8.1.3.566.gaa39828 In-Reply-To: <1374652593-7242-1-git-send-email-morita.kazutaka@lab.ntt.co.jp> References: <1374652593-7242-1-git-send-email-morita.kazutaka@lab.ntt.co.jp> X-Dispatcher: imput version 20100215(IM150) Lines: 43 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (sh.osrg.net [192.16.179.4]); Wed, 24 Jul 2013 16:58:26 +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 v2 1/9] 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. Reviewed-by: Paolo Bonzini Signed-off-by: MORITA Kazutaka --- 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) {