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: Leonid Pauzner
Subject: Re: lynx-dev REUSE_TEMPFILES problem (more)
Date: Fri, 16 Jul 1999 18:38:13 +0400 (MSD)

16-Jul-99 08:31 Klaus Weide wrote:
>> 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'.

DJGPP have no truncate() so the changes you propose below really
equivalent to the present state when HAVE_TRUNCATE undefined (#else case).
The text still appended...

> 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]