stream_smb: remove unnecessary short write logic

See previous commit. It compiles, but 100% untested.
This commit is contained in:
wm4 2019-09-14 13:00:43 +02:00
parent 22568fece6
commit 116ab73566
1 changed files with 4 additions and 11 deletions

View File

@ -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){