bug-glibc
[Top][All Lists]
Advanced

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

fdopen getc problem


From: Matthias Braun
Subject: fdopen getc problem
Date: Wed, 21 Nov 2001 01:19:50 +0100

Hi,

I try to compile ftptool 4.6p1 with gcc 2.95.3 and glibc 2.2.3.
I have the following behaviour.
In the coding a FILE is cretaed with responsefp = fdopen(s, "r"); It is a TCP socket to the ftp server.
In the function getreply the following code exists:

while ((c = getc(responsefp)) != '\n') {
...
}

The effect is now, that if I try to download multiple files and this code is reached for the seconde file, the fgetc give an EOF and the download is canceld. The amazing thing is now, if I place a sleep(1); In front of this while/getc everthing works fine.

So my question is know, is this a bug or feature, that the getc gives an EOF if I read to quick from the opened socket stream?

Any ideas?
Matthias

PS: If I compile the same code under an old libc5 system I do not have this effect.






reply via email to

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