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: Jan Djärv
Subject: Re: unicode build: "comparison is always true" warnings
Date: Sat, 24 Nov 2007 14:08:28 +0100
User-agent: Thunderbird 2.0.0.6 (X11/20071022)

Andreas Schwab skrev:
> Jan Djärv <address@hidden> writes:
> 
>> Ok.  But mkstemp has one advantage that mktemp doesn't have, it does not emit
>> a warning when compiling :-).  I think that is cause enough to use mkstemp
>> where available, even if they both are equivalent.
> 
> 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.
> 

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 != tempname && !IS_DIRECTORY_SEP (p[-1]))
        p--;
        *p = 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 = open (tempname, O_WRONLY | O_CREAT | O_EXCL, 0666);
+ #else
+           strcpy (p, "EXXXXXX");
+           desc = mkstemp (tempname);
+ #endif
          if (desc < 0)
            {
              char *message = (char *) xmalloc (strlen (tempname) + 50);

        Jan D.




reply via email to

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