From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22249 invoked by alias); 25 Apr 2013 20:05:56 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17782 Received: (qmail 25616 invoked from network); 25 Apr 2013 20:05:55 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_NUMERIC_HELO,SPF_HELO_PASS autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at m.gmane.org designates 80.91.229.3 as permitted sender) X-Injected-Via-Gmane: http://gmane.org/ To: zsh-users@zsh.org From: Yuri D'Elia Subject: Re: precmd: write error: interrupted Date: Thu, 25 Apr 2013 22:05:41 +0200 Message-ID: References: <130425111646.ZM17258@torch.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 193.106.183.18 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 In-Reply-To: <130425111646.ZM17258@torch.brasslantern.com> On 04/25/2013 08:16 PM, Bart Schaefer wrote: > } 1) SIGWINCH should either be masked or allow write to restart. > > This requires some thought about the appropriate layer to handle this. > bin_print does already do some signal queuing when writing to internal > data structures (print -z, print -s), but that's deliberately isolated > to bin_print, whereas all sorts of other things might write to the > terminal -- including other error messages! -- so patching bin_print is > not covering all the bases. I actually tried to set SA_RESTART only when installing the handler for SIGWINCH when debugging [1]. It works in this case, but I'm not entirely sure it is side-effect free (is doing an ioctl on the tty safe while mid-write?). What other syscalls would be interrupted by SIGWINCH that shouldn't be restarted? Right now I cannot think of anything that SIGWINCH should interrupt. You can actually reproduce the bug easily by doing: while print 'x'; do; done and resizing the terminal, or by sending SIGWINCH to zsh directly. [1] interestingly enough, why "interact" is tested for the Sunos4 case?