pike.git / src / modules / _Stdio / buffer.cmod

version» Context lines:

pike.git/src/modules/_Stdio/buffer.cmod:1011:    }    io_consume( io, res );    written += res;    nbytes-=res;    io_set_events( io, fd, PIKE_BIT_FD_WRITE_OOB, PIKE_FD_WRITE);    }    }    else    {    /* some other object. Just call write */ -  while( sz > written && nbytes) +  while( sz > written && nbytes )    {    size_t rd = MINIMUM(MINIMUM(sz-written,4096),nbytes);    ptrdiff_t wr = io_call_write( io, f, rd );    if( wr <= 0 )    {    io_rewind(io, rd );    if (!written) written = -1;    break;    }    written += wr;