diff options
Diffstat (limited to 'stream/stream_smb.c')
-rw-r--r-- | stream/stream_smb.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/stream/stream_smb.c b/stream/stream_smb.c index 684940749f..714e80fe79 100644 --- a/stream/stream_smb.c +++ b/stream/stream_smb.c @@ -100,8 +100,16 @@ static int fill_buffer(stream_t *s, char* buffer, int max_len){ } static int write_buffer(stream_t *s, char* buffer, int len) { - int r = smbc_write(s->fd,buffer,len); - return (r <= 0) ? -1 : r; + int r; + int wr = 0; + while (wr < len) { + r = smbc_write(s->fd,buffer,len); + if (r <= 0) + return -1; + wr += r; + buffer += r; + } + return len; } static void close_f(stream_t *s){ |