From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: mah@everybody.org (Mark A. Hershberger) Newsgroups: gmane.emacs.devel Subject: Re: unicode build: "comparison is always true" warnings Date: Sat, 24 Nov 2007 13:24:52 -0500 Message-ID: <87d4tzv6vf.fsf@everybody.org> References: <87oddltv7f.fsf@everybody.org> <87hcjcoo2x.fsf@everybody.org> <87wss8mypv.fsf@everybody.org> <87sl2wmmyk.fsf@everybody.org> <4747EF20.7050604@swipnet.se> <4747FDF6.3050203@swipnet.se> <4748064D.6010405@swipnet.se> <4748224C.6030602@swipnet.se> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1195928730 26563 80.91.229.12 (24 Nov 2007 18:25:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 24 Nov 2007 18:25:30 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 24 19:25:37 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IvzhA-0004zy-MC for ged-emacs-devel@m.gmane.org; Sat, 24 Nov 2007 19:25:36 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ivzgv-0002pB-KV for ged-emacs-devel@m.gmane.org; Sat, 24 Nov 2007 13:25:21 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ivzgq-0002m8-CL for emacs-devel@gnu.org; Sat, 24 Nov 2007 13:25:16 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ivzgn-0002iO-L7 for emacs-devel@gnu.org; Sat, 24 Nov 2007 13:25:14 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ivzgn-0002iD-Hu for emacs-devel@gnu.org; Sat, 24 Nov 2007 13:25:13 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ivzgm-0006e1-RU for emacs-devel@gnu.org; Sat, 24 Nov 2007 13:25:13 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IvzgY-0007SU-L7 for emacs-devel@gnu.org; Sat, 24 Nov 2007 18:24:58 +0000 Original-Received: from 24.115.83.248.res-cmts.eph.ptd.net ([24.115.83.248]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 24 Nov 2007 18:24:58 +0000 Original-Received: from mah by 24.115.83.248.res-cmts.eph.ptd.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 24 Nov 2007 18:24:58 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 40 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 24.115.83.248.res-cmts.eph.ptd.net X-URL: http://mah.everybody.org/weblog/ User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:NQAmMxP8b9JRx8xX8WkXhToDPtI= X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:84068 Archived-At: Andreas Schwab writes: > I'd suggest moving the mktemp into the loop as well. This will avoid > code duplication. like this? --- movemail.c 26 Jul 2007 05:26:12 -0000 1.88 +++ movemail.c 24 Nov 2007 18:23:43 -0000 @@ -324,15 +324,20 @@ while (p != tempname && !IS_DIRECTORY_SEP (p[-1])) p--; *p = 0; - strcpy (p, "EXXXXXX"); - mktemp (tempname); - unlink (tempname); while (1) { /* Create the lock file, but not under the lock file name. */ /* Give up if cannot do that. */ + strcpy (p, "EXXXXXX"); +#ifndef HAVE_MKSTEMP + mktemp (tempname); + unlink (tempname); desc = open (tempname, O_WRONLY | O_CREAT | O_EXCL, 0666); +#else + desc = mkstemp (tempname); +#endif + if (desc < 0) { char *message = (char *) xmalloc (strlen (tempname) + 50); -- http://hexmode.com/ GPG Fingerprint: 7E15 362D A32C DFAB E4D2 B37A 735E F10A 2DFC BFF5 The most beautiful experience we can have is the mysterious. -- Albert Einstein, The World As I See it