[Top][All Lists]

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

lynx-dev patch: REUSE_TEMPFILE fixed for DJGPP port

From: Leonid Pauzner
Subject: lynx-dev patch: REUSE_TEMPFILE fixed for DJGPP port
Date: Sat, 9 Oct 1999 22:28:12 +0400 (MSD)

Cleaning up my hard disk I found out my old notes
on lynx.cfg option REUSE_TEMPFILES for DJGPP lynx port.
The problem still not fixed: temp file is not truncated to zero size
but grouth in length each time.

Well, I found an obvious fix (HAVE_TRUNCATE was not defined for DJGPP),
but how about platforms which happens have no truncate()
nor HAVE_TRANCATE defined?
>From LYUtils.c::LYOpenTempRewrite():

    } else if (is_ours) {
         *  Yes, it exists, is writable if we checked, and everything
         *  looks ok so far.  This should be the most regular case.
         *  We truncate and then append, this avoids having a small
         *  window in which the file doesn't exist. - kw
        if (truncate(fname, 0) != 0) {
            CTRACE(tfp, "... truncate(%s,0) failed: %s\n",
                   fname, LYStrerror(errno));
            return (LYOpenTemp(fname, suffix, mode));
        return (LYReopenTemp(fname));



diff -u old/htutils.h ./htutils.h
--- old/htutils.h       Wed Sep  1 18:06:20 1999
+++ ./htutils.h Sat Oct  9 21:48:10 1999
@@ -21,6 +21,7 @@

 #ifdef DJGPP
 #include <sys/config.h>        /* pseudo-autoconf values for DJGPP 
libc/headers */
+#define HAVE_TRUNCATE 1
 #endif /* DJGPP */

 #include <stdio.h>

reply via email to

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