[Top][All Lists]
[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
- Re: unicode build: "comparison is always true" warnings, (continued)
- Re: unicode build: "comparison is always true" warnings, Glenn Morris, 2007/11/23
- Re: unicode build: "comparison is always true" warnings, Andreas Schwab, 2007/11/23
- Re: unicode build: "comparison is always true" warnings, Mark A. Hershberger, 2007/11/23
- Re: unicode build: "comparison is always true" warnings, Andreas Schwab, 2007/11/23
- Re: unicode build: "comparison is always true" warnings, Mark A. Hershberger, 2007/11/23
- Re: unicode build: "comparison is always true" warnings, Andreas Schwab, 2007/11/24
- Re: unicode build: "comparison is always true" warnings, Jan Djärv, 2007/11/24
- Re: unicode build: "comparison is always true" warnings, Andreas Schwab, 2007/11/24
- Message not available
- Message not available
- Message not available
- Message not available
- Re: unicode build: "comparison is always true" warnings, Jan Djärv, 2007/11/24
- Re: unicode build: "comparison is always true" warnings, Andreas Schwab, 2007/11/24
- Re: unicode build: "comparison is always true" warnings,
Mark A. Hershberger <=
- Re: unicode build: "comparison is always true" warnings, Matthieu Lemerre, 2007/11/24
- Re: unicode build: "comparison is always true" warnings, Andreas Schwab, 2007/11/24
- Re: unicode build: "comparison is always true" warnings, Matthieu Lemerre, 2007/11/24
- Re: unicode build: "comparison is always true" warnings, David Kastrup, 2007/11/24
- Re: unicode build: "comparison is always true" warnings, Andreas Schwab, 2007/11/24
- Re: unicode build: "comparison is always true" warnings, David Kastrup, 2007/11/24
- Re: unicode build: "comparison is always true" warnings, Mark A. Hershberger, 2007/11/23
- Re: unicode build: "comparison is always true" warnings, Andreas Schwab, 2007/11/23