stream_file: remove unnecessary short write logic

See previous commit.
This commit is contained in:
wm4 2019-09-14 13:00:10 +02:00
parent bec218c4ad
commit 22568fece6
1 changed files with 1 additions and 10 deletions

View File

@ -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) static int write_buffer(stream_t *s, char *buffer, int len)
{ {
struct priv *p = s->priv; struct priv *p = s->priv;
int r = len; return write(p->fd, buffer, len);
int wr;
while (r > 0) {
wr = write(p->fd, buffer, r);
if (wr <= 0)
return -1;
r -= wr;
buffer += wr;
}
return len - r;
} }
static int seek(stream_t *s, int64_t newpos) static int seek(stream_t *s, int64_t newpos)