From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12088 invoked from network); 7 Dec 2007 11:31:09 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 7 Dec 2007 11:31:09 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 39449 invoked from network); 7 Dec 2007 11:31:06 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 7 Dec 2007 11:31:06 -0000 Received: (qmail 26052 invoked by alias); 7 Dec 2007 11:31:04 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24180 Received: (qmail 26036 invoked from network); 7 Dec 2007 11:31:03 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 7 Dec 2007 11:31:03 -0000 Received: (qmail 39122 invoked from network); 7 Dec 2007 11:31:03 -0000 Received: from cluster-g.mailcontrol.com (85.115.41.190) by a.mx.sunsite.dk with SMTP; 7 Dec 2007 11:30:55 -0000 Received: from rly17g.srv.mailcontrol.com (localhost.localdomain [127.0.0.1]) by rly17g.srv.mailcontrol.com (MailControl) with ESMTP id lB7BUhcS001775 for ; Fri, 7 Dec 2007 11:30:52 GMT Received: from submission.mailcontrol.com (submission.mailcontrol.com [86.111.216.190]) by rly17g.srv.mailcontrol.com (MailControl) id lB7BU8OX032088 for zsh-workers@sunsite.dk; Fri, 7 Dec 2007 11:30:08 GMT Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly17g-eth0.srv.mailcontrol.com (envelope-sender Peter.Stephenson@csr.com) (MIMEDefang) with ESMTP id lB7BScFk026827; Fri, 07 Dec 2007 11:30:08 +0000 (GMT) Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.1830); Fri, 7 Dec 2007 11:29:22 +0000 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.14.1/8.13.4) with ESMTP id lB7BTM2L012752; Fri, 7 Dec 2007 11:29:22 GMT Received: from csr.com (pws@localhost) by news01.csr.com (8.14.1/8.14.1/Submit) with ESMTP id lB7BTMoH012749; Fri, 7 Dec 2007 11:29:22 GMT Message-Id: <200712071129.lB7BTMoH012749@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: "Zsh Hackers' List" , Guillaume Chazarain Subject: Re: deadlock caused by gettext usage in a signal handler In-reply-to: <20071207114631.7fa1eab9@inria.fr> References: <20071130203534.1d1ea29c@inria.fr> <20071204203017.35a29727.p.w.stephenson@ntlworld.com> <20071207000207.2eb7e5e7@inria.fr> <20071207103533.47776664@news01> <20071207114631.7fa1eab9@inria.fr> Comments: In-reply-to Guillaume Chazarain message dated "Fri, 07 Dec 2007 11:46:31 +0100." Date: Fri, 07 Dec 2007 11:29:22 +0000 From: Peter Stephenson X-OriginalArrivalTime: 07 Dec 2007 11:29:22.0868 (UTC) FILETIME=[6A53C740:01C838C4] X-Scanned-By: MailControl A-08-00-01 (www.mailcontrol.com) on 10.71.1.127 Guillaume Chazarain wrote: > Thanks, how about reverting the strerror_r one (also in zsh-4.2)? That's probably neater, given the hack to get it to work. However, it's marginally neater to keep the errmsg variable. It makes it look like I've done something. Index: configure.ac =================================================================== RCS file: /cvsroot/zsh/zsh/configure.ac,v retrieving revision 1.85 diff -u -r1.85 configure.ac --- configure.ac 7 Dec 2007 02:53:17 -0000 1.85 +++ configure.ac 7 Dec 2007 11:25:52 -0000 @@ -1157,7 +1157,7 @@ getlogin getpwent getpwnam getpwuid getgrgid getgrnam \ initgroups nis_list \ setuid seteuid setreuid setresuid setsid \ - memcpy memmove strstr strerror strerror_r \ + memcpy memmove strstr strerror \ getrlimit getrusage \ setlocale \ uname \ Index: Src/utils.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/utils.c,v retrieving revision 1.172 diff -u -r1.172 utils.c --- Src/utils.c 3 Dec 2007 22:46:11 -0000 1.172 +++ Src/utils.c 7 Dec 2007 11:26:01 -0000 @@ -310,34 +310,7 @@ errflag = 1; return; } -#ifdef HAVE_STRERROR_R - /* - * There are two incompatible strerror_r()s floating round. - * The GNU extension refuses to copy the message into the - * buffer if it can return a constant string. To suppress it - * we need to define _XOPEN_SOURCE to 600. I don't dare do - * this because we're already depending on _GNU_SOURCE. So - * try to handle both by looking for errno being set (for the - * standard version failing) or errbuf being left untouched - * (for the GNU version). One presumes that if strerror_r() - * didn't copy anything to errbuf, then it's safe to - * call strerror() to get the string. - * - * This is a mess, but it's about a decade and half - * too late to shirk from messes in the source. - */ - olderrno = errno; - errno = 0; - errbuf[0] = '\0'; - strerror_r(num, errbuf, ERRBUFSIZE); - if (errno || errbuf[0] == '\0') - errmsg = strerror(num); - else - errmsg = errbuf; - errno = olderrno; -#else errmsg = strerror(num); -#endif /* If the message is not about I/O problems, it looks better * * if we uncapitalize the first letter of the message */ if (num == EIO) -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070