(fullwrite): Get rid of an extra call to write. Problem
pointed out by Chiaki Ishikawa.
This commit is contained in:
parent
2ed2806cd9
commit
9d3f4cee9d
1 changed files with 2 additions and 2 deletions
|
@ -1410,10 +1410,10 @@ fullwrite (fd, buf, nbytes)
|
|||
int nbytes;
|
||||
{
|
||||
char *cp;
|
||||
int ret;
|
||||
int ret = 0;
|
||||
|
||||
cp = buf;
|
||||
while ((ret = SEND (fd, cp, nbytes, 0)) > 0)
|
||||
while (nbytes && ((ret = SEND (fd, cp, nbytes, 0)) > 0))
|
||||
{
|
||||
cp += ret;
|
||||
nbytes -= ret;
|
||||
|
|
Loading…
Add table
Reference in a new issue