From patchwork Sat Aug 30 19:40:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Palka X-Patchwork-Id: 2601 Received: (qmail 22969 invoked by alias); 30 Aug 2014 19:41:15 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 22949 invoked by uid 89); 30 Aug 2014 19:41:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-HELO: mail-qg0-f46.google.com Received: from mail-qg0-f46.google.com (HELO mail-qg0-f46.google.com) (209.85.192.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 30 Aug 2014 19:41:08 +0000 Received: by mail-qg0-f46.google.com with SMTP id q107so3628141qgd.5 for ; Sat, 30 Aug 2014 12:41:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=a6tvKgabQ/oLJw+xJGISnggn3+bgQkQE9xrP060FDpQ=; b=XpfzF0yhFgkFdam57T31GdsGba27xts0PHzLFIBhuD9eNbc9u/rKZ9UwT9Q06ncPVL LPqvFqgOhAf6uPm3P0ShX3Xd1abLwhWNgAPKmg14n7DFIS8sx35QOpzmnwIp5rGPAIK6 eeUaouZFf/CDUsw5Hd4QGX0xsC5Dk3ZwdbKt9qpw9rzXyUEpyx1qXtm8j5hoS0yIjwAS Zpyl0DQMNOzRSohyzd/bF7ABk/xzJItih99L5OG7xeWNt+V+Q9hU+8VjMpIJE8wH75Xk 9SnFYMNopnKxMkZtoIvHq3uYSdqKrH9Jzqp/OgbOgC9mgK/z7CISiSdLeQU9TjRGW8nf KnlA== X-Gm-Message-State: ALoCoQln+BaAT4pM4mrvjveYto1WZ14zWPlWsmVsdybBPUJUxScUcKH2/odloLkiyHJwV8AX3tmM X-Received: by 10.224.46.68 with SMTP id i4mr29751472qaf.73.1409427666376; Sat, 30 Aug 2014 12:41:06 -0700 (PDT) Received: from localhost.localdomain (ool-4353af5c.dyn.optonline.net. [67.83.175.92]) by mx.google.com with ESMTPSA id t95sm5285035qgd.47.2014.08.30.12.41.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 30 Aug 2014 12:41:05 -0700 (PDT) From: Patrick Palka To: gdb-patches@sourceware.org Cc: Patrick Palka Subject: [PATCH] Specify SA_RESTART when registering the SIGWINCH signal handler Date: Sat, 30 Aug 2014 15:40:56 -0400 Message-Id: <1409427656-27102-1-git-send-email-patrick@parcs.ath.cx> X-IsSubscribed: yes SA_RESTART allows system calls to be restarted across a signal handler. By specifying this flag we fix the issue where if the user is being prompted to answer yes or no, and the terminal gets resized in the meantime, the prompt will think that the user sent an EOF and so it will take the default action for that prompt (in the case of the quit prompt, it will quit GDB). * tui/tui-win.c (tui_initialize_win): Specify SA_RESTART when registering the signal handler. --- gdb/tui/tui-win.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c index 9c7a23f..b117634 100644 --- a/gdb/tui/tui-win.c +++ b/gdb/tui/tui-win.c @@ -834,6 +834,9 @@ tui_initialize_win (void) memset (&old_winch, 0, sizeof (old_winch)); old_winch.sa_handler = &tui_sigwinch_handler; +#ifdef SA_RESTART + old_winch.sa_flags = SA_RESTART; +#endif sigaction (SIGWINCH, &old_winch, NULL); #else signal (SIGWINCH, &tui_sigwinch_handler);