emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: unicode build: "comparison is always true" warnings


From: Mark A. Hershberger
Subject: Re: unicode build: "comparison is always true" warnings
Date: Sat, 24 Nov 2007 13:24:52 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Andreas Schwab <address@hidden> 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]