From patchwork Sat Aug 3 11:48:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 1141480 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=web.de Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=web.de header.i=@web.de header.b="DibPvJqq"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4612Nx2Xnlz9sNf for ; Sat, 3 Aug 2019 21:48:49 +1000 (AEST) Received: from localhost ([::1]:39474 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1htsWl-0005mk-EP for incoming@patchwork.ozlabs.org; Sat, 03 Aug 2019 07:48:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49764) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1htsWP-0005lZ-0Q for qemu-devel@nongnu.org; Sat, 03 Aug 2019 07:48:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1htsWM-00047i-O8 for qemu-devel@nongnu.org; Sat, 03 Aug 2019 07:48:24 -0400 Received: from mout.web.de ([212.227.15.14]:41225) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1htsWK-00045d-D0 for qemu-devel@nongnu.org; Sat, 03 Aug 2019 07:48:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1564832893; bh=9SmLDVmHRVKud2yiEpRrOvvnfjZGGe/9qn2KjwG5YFI=; h=X-UI-Sender-Class:To:From:Subject:Date; b=DibPvJqqZhw2hRMGH3ATR7K9YE36fR6SeJctMQ4hkCDPDXiOozL0PR/XsNWVTM47r ArWHdU5BAIm5Ffoa6K+Wu1Px77q/pVfqRKJRbCfxfnfiKS+kQPOrmbIJ3hWRar6HUJ GXzW5sx5eHAqAB7NY/nphTAkVdtUJnMrG8UZ5vg4= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [192.168.1.10] ([95.157.55.156]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LuIAZ-1iJU8g3Fup-011fiD for ; Sat, 03 Aug 2019 13:48:13 +0200 To: qemu-devel From: Jan Kiszka Message-ID: <6976a3e4-d484-56cb-5450-f4a72cc6dddc@web.de> Date: Sat, 3 Aug 2019 13:48:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 Content-Language: en-US X-Provags-ID: V03:K1:5BREKjVvA8ahMaaIedLwMQQssgO4f+nGuZP2Nr1kED/nTsb/xS0 X3nn/NZyeJk/Bmp3QuQU9HpNsa4hQmrL95+6JkQhq6xuQ9VEAukGPU5kH11rdlttUAWxuB5 faO6V9M2TkW0iVFJqp/+66d5hr4iVJ9lEbfcqkkFlwD7g80VFBuThIdQ2KLENwriYkz8uuq lAgCkWhFC2x860fLR0v3A== X-UI-Out-Filterresults: notjunk:1; V03:K0:WNyWwjp8urc=:MU6T3kHxh38FEUmStOl7xU YCtrf4ix/jm5PdcUIG0+DiM56rOOuFPpgP3q8PVfUaGNILOy84VSOgpj7r5e1Y0ssHWf+72rp eqex0DaIb+VJWvXLhAkptxCGhsHmtBLsdcoHrX6fKmueE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s.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.14 Subject: [Qemu-devel] [PATCH] ivshmem-server: Terminate also on SIGINT X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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" From: Jan Kiszka Allows to shutdown a foreground session via ctrl-c. Signed-off-by: Jan Kiszka --- contrib/ivshmem-server/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.16.4 diff --git a/contrib/ivshmem-server/main.c b/contrib/ivshmem-server/main.c index 197c79c57e..8a81cdb04c 100644 --- a/contrib/ivshmem-server/main.c +++ b/contrib/ivshmem-server/main.c @@ -223,7 +223,8 @@ main(int argc, char *argv[]) sa_quit.sa_handler = ivshmem_server_quit_cb; sa_quit.sa_flags = 0; if (sigemptyset(&sa_quit.sa_mask) == -1 || - sigaction(SIGTERM, &sa_quit, 0) == -1) { + sigaction(SIGTERM, &sa_quit, 0) == -1 || + sigaction(SIGINT, &sa_quit, 0) == -1) { perror("failed to add SIGTERM handler; sigaction"); goto err; }