[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: unicode build: "comparison is always true" warnings
From: |
Andreas Schwab |
Subject: |
Re: unicode build: "comparison is always true" warnings |
Date: |
Sat, 24 Nov 2007 14:57:42 +0100 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (gnu/linux) |
Jan Djärv <address@hidden> writes:
> 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);
I'd suggest moving the mktemp into the loop as well. This will avoid
code duplication.
Andreas.
--
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
- Re: unicode build: "comparison is always true" warnings, (continued)
- Re: unicode build: "comparison is always true" warnings, Stefan Monnier, 2007/11/23
- 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 <=
- Re: unicode build: "comparison is always true" warnings, Mark A. Hershberger, 2007/11/24
- 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