stream_smb: fix compilation

Accidentally forgotten in commit a4d487.
This commit is contained in:
wm4 2014-05-24 17:00:30 +02:00
parent 01c3847b80
commit e47e818356
1 changed files with 4 additions and 4 deletions

View File

@ -98,7 +98,8 @@ static int open_f (stream_t *stream)
filename = stream->url;
mode_t m = stream->mode == STREAM_WRITE ? O_RDWR|O_CREAT|O_TRUNC : O_RDONLY;
bool write = stream->mode == STREAM_WRITE;
mode_t m = write ? O_RDWR|O_CREAT|O_TRUNC : O_RDONLY;
if(!filename) {
MP_ERR(stream, "[smb] Bad url\n");
@ -117,13 +118,12 @@ static int open_f (stream_t *stream)
return STREAM_ERROR;
}
stream->flags = mode;
len = 0;
if(mode == STREAM_READ) {
if(!write) {
len = smbc_lseek(fd,0,SEEK_END);
smbc_lseek (fd, 0, SEEK_SET);
}
if(len > 0 || mode == STREAM_WRITE) {
if(len > 0 || write) {
stream->seekable = true;
stream->seek = seek;
}