From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50499) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgD6B-0007FB-Ji for qemu-devel@nongnu.org; Tue, 12 Nov 2013 07:29:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VgD65-0005PZ-Ik for qemu-devel@nongnu.org; Tue, 12 Nov 2013 07:29:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:61918) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgD65-0005PE-A7 for qemu-devel@nongnu.org; Tue, 12 Nov 2013 07:29:33 -0500 Message-ID: <52821FD0.4050202@redhat.com> Date: Tue, 12 Nov 2013 13:32:16 +0100 From: Laszlo Ersek MIME-Version: 1.0 References: <1384245814-15010-1-git-send-email-kraxel@redhat.com> <528216C7.10705@redhat.com> <1384258582.1272.26.camel@nilsson.home.kraxel.org> In-Reply-To: <1384258582.1272.26.camel@nilsson.home.kraxel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] curses: fixup SIGWINCH handler mess List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org, Anthony Liguori On 11/12/13 13:16, Gerd Hoffmann wrote: >> justification for the patch.) My point though is that after this patch a >> narrow window seems to exist where you can lose a signal, namely between >> checking "got_sigwinch" and resetting it. > > Doesn't matter. The signal just says "terminal size has changed", > typically as result of a xterm window resize. Even if we get that twice > we have to handle it only once, we just have to make sure this happens > after the second signal came in. Which is the case, as we reset > got_sigwinch before going to handle it (query new size, tell curses). Ah, correct. We do lose the second signal (the one which was delivered between we retrieve the flag set by the first instance, and resetting the flag), but at that point we're going to handle *one* resize event anyway. Supposing that the second signal was generated *after* the terminal size had changed for the second time, we'll see a recent enough terminal size when we query it. So, we lose the second signal and the *first* terminal size. Good. Thanks! Laszlo