lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev REUSE_TEMPFILES problem (more)


From: Klaus Weide
Subject: Re: lynx-dev REUSE_TEMPFILES problem (more)
Date: Fri, 16 Jul 1999 08:31:16 -0500 (CDT)

On Fri, 16 Jul 1999, Leonid Pauzner wrote:
> 16-Jul-99 06:49 Klaus Weide wrote:
> > I didn't realize that NO_GROUPS was only set privately in HTFile.c.
> > It has to be defined for DOS in LYUtils.c, too.  Should the #define's
> > move from HTFile.c to some .h, or do I need to change the
> > LYOpenTempRewrite() logic?
> 
> Both. I move all the whole NO_GROUPS chunk from HTFile.c to HTFile.h
> and rebuilt LYUtils.c. Now we got "our file" but the page not rewritten
> but APPENDED (without any notice in the trace log) - I just see the options
> menu incremented by 8Kb in size each time (same for Info Page, etc.).

It seems something wend wrong with the logic when Tom added the
'#ifdef HAVE_TRUNCATE'.

We now have:

#if HAVE_TRUNCATE
        if (truncate(fname, 0) != 0) {
            CTRACE(tfp, "... truncate(%s,0) failed: %s\n",
                   fname, LYStrerror(errno));
            return (LYOpenTemp(fname, suffix, mode));
        }
#endif
        return (LYReopenTemp(fname));


In my patch, that was:

        if (truncate(fname, 0) != 0) {
            CTRACE(tfp, "... truncate(%s,0) failed: %s\n",
                   fname, LYStrerror(errno));
            return (LYOpenTemp(fname, suffix, mode));
        } else {
            return (LYReopenTemp(fname));
        }


That is, LYReopenTemp(fname) only gets called if the truncate()
worked.  Please try this instead; let's see whether LYOpenTemp() will
do the right thing in DOS:

#if HAVE_TRUNCATE
        if (truncate(fname, 0) == 0) {  /* success */
            return (LYReopenTemp(fname));
        } else {
            CTRACE(tfp, "... truncate(%s,0) failed: %s\n",
                   fname, LYStrerror(errno));
            return (LYOpenTemp(fname, suffix, mode));
        }
#else
        return (LYOpenTemp(fname, suffix, mode));
#endif



   Klaus


reply via email to

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