From patchwork Sun Nov 16 03:51:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Palka X-Patchwork-Id: 3771 Received: (qmail 31971 invoked by alias); 16 Nov 2014 03:51:41 -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 31960 invoked by uid 89); 16 Nov 2014 03:51:40 -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-pa0-f49.google.com Received: from mail-pa0-f49.google.com (HELO mail-pa0-f49.google.com) (209.85.220.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sun, 16 Nov 2014 03:51:39 +0000 Received: by mail-pa0-f49.google.com with SMTP id lj1so19974710pab.36 for ; Sat, 15 Nov 2014 19:51:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=HXA+zqWX4HY9CPQe9wE2K6Srq+p9x1qz8qvNc5Dvvf0=; b=AiR0Zn+U0U0Ivn4IoLhHL+R2Hz+5j22rYfiLCAwGg0tTwJfO9MKivmGFvODcgoCyhv KOUCfjGX794Ah0IEHC64OhcSttoa8sK8os8n+hNxpKFvTdCqt2Zlov+NVjHgL8JONbQo iHPxr29GC2mcTB7lp7xpaqbkq4itLV4cKRnu6oNmlwZrj2xo40Q4EENkId9i4ReodpcW iCpu9uoNBNU+2yXOLv6CU24dm31dNYDXRIeQSnJwpfXRoFZ8BBtfkDFjj39i/Lm51kmf KAIFxNLN4iT6alVOjtZDuL0WnPSrG21dtXuW22iuXzj2+0+MsRfffk8CEMKvLPsIFY+v lb4w== X-Gm-Message-State: ALoCoQmqwI8VkvIuRAJG+blr9ZjikP3FHvHF9j2CWEn7suwsHNxp2bk/qyxC5jNAybV794X9hnHx X-Received: by 10.70.48.38 with SMTP id i6mr20843606pdn.74.1416109897258; Sat, 15 Nov 2014 19:51:37 -0800 (PST) MIME-Version: 1.0 Received: by 10.70.31.100 with HTTP; Sat, 15 Nov 2014 19:51:15 -0800 (PST) In-Reply-To: <540842BA.2040608@redhat.com> References: <1409427656-27102-1-git-send-email-patrick@parcs.ath.cx> <540842BA.2040608@redhat.com> From: Patrick Palka Date: Sat, 15 Nov 2014 22:51:15 -0500 Message-ID: Subject: Re: [PATCH] Specify SA_RESTART when registering the SIGWINCH signal handler To: Pedro Alves Cc: gdb-patches@sourceware.org X-IsSubscribed: yes On Thu, Sep 4, 2014 at 6:45 AM, Pedro Alves wrote: > On 08/30/2014 08:40 PM, Patrick Palka wrote: >> 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. > > OK. > > Thanks, > Pedro Alves Hi, Could someone commit this patch (attached) for me? From c152b0da4286424050457f66c067923fcf8d330a Mon Sep 17 00:00:00 2001 From: Patrick Palka Date: Sat, 30 Aug 2014 15:33:08 -0400 Subject: [PATCH] Specify SA_RESTART when registering the SIGWINCH signal handler 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 d17a1e4..4488da8 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); -- 2.2.0.rc1.23.gf570943