Re: Windows port merge - Miscellaneos changes [PATCH]

From: Guido Serassio <serassio@dont-contact.us>
Date: Tue, 04 Feb 2003 12:48:11 +0100

Hi Robert,

At 22.29 03/02/2003, Robert Collins wrote:
>On Tue, 2003-02-04 at 05:00, Guido Serassio wrote:
>
>
> > - File open is forced in binary mode
>
>This is a wrong way to tackle (whatever) problem you've encounteded. The
>caller of this function specifies the mode as binary or text. I'm
>applying the rest of the patches though.

I have just found the reason of this:
On Windows, when opening a file as O_TEXT, the resulting bytes count from a
read() can be different from the real disk size.
So errorTryLoadText() in errorpage.cc and netdbReloadState() in net_db.c
doesn't work correctly.

So, attached there is a patch to fix this.

Only a question, O_TEXT is really needed ?, or we can simply change O_TEXT
to O_BINARY for all platforms ?

Another thing:

I have discovered a bug in errorTryLoadText() when the read() fails: a NULL
pointer is used in string functions. In the attached patch there is a fix
to this too.
The problem is present in 2.5 too.

Regards

Guido

>Cheers,
>Rob
>--
>GPG key available at: <http://users.bigpond.net.au/robertc/keys.txt>.

-
=======================================================
Serassio Guido
Via Albenga, 11/4 10134 - Torino - ITALY
E-mail: guido.serassio@serassio.it
WWW: http://www.serassio.it

Received on Tue Feb 04 2003 - 04:48:43 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:19:13 MST