diff options
author | wm4 <wm4@nowhere> | 2019-09-14 13:00:43 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-09-14 13:00:43 +0200 |
commit | 116ab73566b17e935d3f7371b18d03d13e5610ca (patch) | |
tree | 6c1fd751d0d0a15b8e21f288e11d509dbfdc70e1 /stream | |
parent | 22568fece655500501e202fe53b49420e07d5fb6 (diff) | |
download | mpv-116ab73566b17e935d3f7371b18d03d13e5610ca.tar.bz2 mpv-116ab73566b17e935d3f7371b18d03d13e5610ca.tar.xz |
stream_smb: remove unnecessary short write logic
See previous commit. It compiles, but 100% untested.
Diffstat (limited to 'stream')
-rw-r--r-- | stream/stream_smb.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/stream/stream_smb.c b/stream/stream_smb.c index bc51796bbc..630da0f757 100644 --- a/stream/stream_smb.c +++ b/stream/stream_smb.c @@ -85,18 +85,11 @@ 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) { - pthread_mutex_lock(&smb_lock); - wr = smbc_write(p->fd,buffer,r); - pthread_mutex_unlock(&smb_lock); - if (wr <= 0) - return -1; - r -= wr; - buffer += wr; - } - return len - r; + pthread_mutex_lock(&smb_lock); + wr = smbc_write(p->fd,buffer,len); + pthread_mutex_unlock(&smb_lock); + return wr; } static void close_f(stream_t *s){ |