From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Jan_Dj=E4rv?= Newsgroups: gmane.emacs.devel Subject: Re: unicode build: "comparison is always true" warnings Date: Sat, 24 Nov 2007 14:08:28 +0100 Message-ID: <4748224C.6030602@swipnet.se> 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> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1195909761 8151 80.91.229.12 (24 Nov 2007 13:09:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 24 Nov 2007 13:09:21 +0000 (UTC) Cc: Emacs-Devel To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 24 14:09:28 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 1IvulE-00042m-8X for ged-emacs-devel@m.gmane.org; Sat, 24 Nov 2007 14:09:28 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ivukz-0008HA-HP for ged-emacs-devel@m.gmane.org; Sat, 24 Nov 2007 08:09:13 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ivukw-0008H3-Pg for emacs-devel@gnu.org; Sat, 24 Nov 2007 08:09:10 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ivukw-0008Gr-Dj for emacs-devel@gnu.org; Sat, 24 Nov 2007 08:09:10 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ivukw-0008Go-6N for emacs-devel@gnu.org; Sat, 24 Nov 2007 08:09:10 -0500 Original-Received: from av9-2-sn3.vrr.skanova.net ([81.228.9.186]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ivukv-0004d8-PY for emacs-devel@gnu.org; Sat, 24 Nov 2007 08:09:10 -0500 Original-Received: by av9-2-sn3.vrr.skanova.net (Postfix, from userid 502) id 247C238614; Sat, 24 Nov 2007 14:09:08 +0100 (CET) Original-Received: from smtp3-1-sn3.vrr.skanova.net (smtp3-1-sn3.vrr.skanova.net [81.228.9.101]) by av9-2-sn3.vrr.skanova.net (Postfix) with ESMTP id D5AF3385AD; Sat, 24 Nov 2007 14:09:07 +0100 (CET) Original-Received: from husetbladh.homeip.net (90-231-102-24-no59.tbcn.telia.com [90.231.102.24]) by smtp3-1-sn3.vrr.skanova.net (Postfix) with ESMTP id C038D37E45; Sat, 24 Nov 2007 14:09:07 +0100 (CET) User-Agent: Thunderbird 2.0.0.6 (X11/20071022) In-Reply-To: X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 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:84046 Archived-At: Andreas Schwab skrev: > Jan Dj=E4rv writes: >=20 >> Ok. But mkstemp has one advantage that mktemp doesn't have, it does n= ot emit >> a warning when compiling :-). I think that is cause enough to use mks= temp >> where available, even if they both are equivalent. >=20 > It also adds complexity to a already quite complex program for its > task. And as the first attempt shows, it is not trivial to use mkstemp > without breaking the program. >=20 The patch just needs some small changes: *** movemail.c.~1.88.~ 2007-07-27 09:52:07.000000000 +0200 --- movemail.c 2007-11-24 14:07:13.000000000 +0100 *************** *** 324,338 **** --- 324,345 ---- while (p !=3D tempname && !IS_DIRECTORY_SEP (p[-1])) p--; *p =3D 0; + #ifndef HAVE_MKSTEMP strcpy (p, "EXXXXXX"); mktemp (tempname); unlink (tempname); + #endif while (1) { /* Create the lock file, but not under the lock file name. */ /* Give up if cannot do that. */ + #ifndef HAVE_MKSTEMP desc =3D open (tempname, O_WRONLY | O_CREAT | O_EXCL, 0666); + #else + strcpy (p, "EXXXXXX"); + desc =3D mkstemp (tempname); + #endif if (desc < 0) { char *message =3D (char *) xmalloc (strlen (tempname) + 50)= ; Jan D.