mirror of
https://framagit.org/bortzmeyer/echoping
synced 2024-11-16 21:25:37 +00:00
Back to read() because of broken Solaris
This commit is contained in:
parent
26e12c3d67
commit
ce8842eea8
@ -16,6 +16,7 @@ readline (fs, ptr, maxlen, ln)
|
||||
{
|
||||
int n = 1;
|
||||
char *rc;
|
||||
int r;
|
||||
|
||||
if (ln)
|
||||
{
|
||||
@ -32,8 +33,8 @@ readline (fs, ptr, maxlen, ln)
|
||||
{
|
||||
while (n < maxlen)
|
||||
{
|
||||
rc = fgets (ptr, maxlen, fs);
|
||||
if (rc == NULL)
|
||||
r = read (fileno(fs), ptr, maxlen);
|
||||
if (r == 0)
|
||||
{
|
||||
if (timeout_flag)
|
||||
return n;
|
||||
@ -42,7 +43,7 @@ readline (fs, ptr, maxlen, ln)
|
||||
else
|
||||
break; /* EOF, some data was read */
|
||||
}
|
||||
n = n + strlen (rc);
|
||||
n = n + r;
|
||||
}
|
||||
}
|
||||
return (n);
|
||||
|
Loading…
Reference in New Issue
Block a user