diff --git a/stream/stream_file.c b/stream/stream_file.c index 5d424d66d6..dd7bfba581 100644 --- a/stream/stream_file.c +++ b/stream/stream_file.c @@ -123,16 +123,7 @@ static int fill_buffer(stream_t *s, char *buffer, int max_len) static int write_buffer(stream_t *s, char *buffer, int len) { struct priv *p = s->priv; - int r = len; - int wr; - while (r > 0) { - wr = write(p->fd, buffer, r); - if (wr <= 0) - return -1; - r -= wr; - buffer += wr; - } - return len - r; + return write(p->fd, buffer, len); } static int seek(stream_t *s, int64_t newpos)