diff options
Diffstat (limited to 'stream/stream_file.c')
-rw-r--r-- | stream/stream_file.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/stream/stream_file.c b/stream/stream_file.c index 319a92f08b..dc5a3ed6f7 100644 --- a/stream/stream_file.c +++ b/stream/stream_file.c @@ -123,16 +123,16 @@ 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; - int wr = 0; - while (wr < len) { - r = write(p->fd, buffer, len); - if (r <= 0) + int r = len; + int wr; + while (r > 0) { + wr = write(p->fd, buffer, r); + if (wr <= 0) return -1; - wr += r; - buffer += r; + r -= wr; + buffer += wr; } - return len; + return len - r; } static int seek(stream_t *s, int64_t newpos) @@ -196,7 +196,7 @@ static bool check_stream_network(int fd) { struct statfs fs; const char *stypes[] = { "afpfs", "nfs", "smbfs", "webdav", "osxfusefs", - NULL }; + "fuse", "fusefs.sshfs", NULL }; if (fstatfs(fd, &fs) == 0) for (int i=0; stypes[i]; i++) if (strcmp(stypes[i], fs.f_fstypename) == 0) |