summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-05-24 17:00:30 +0200
committerwm4 <wm4@nowhere>2014-05-24 17:00:30 +0200
commite47e818356b33cb125e18cb119a48741ab944e91 (patch)
treefe459987ed8eb3ac3978ddc4b9efa356f2653a8b /stream
parent01c3847b80d32387dfc5aae70f43d914616e3dc1 (diff)
downloadmpv-e47e818356b33cb125e18cb119a48741ab944e91.tar.bz2
mpv-e47e818356b33cb125e18cb119a48741ab944e91.tar.xz
stream_smb: fix compilation
Accidentally forgotten in commit a4d487.
Diffstat (limited to 'stream')
-rw-r--r--stream/stream_smb.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/stream/stream_smb.c b/stream/stream_smb.c
index e39c758fdf..f2fb2fd01a 100644
--- a/stream/stream_smb.c
+++ b/stream/stream_smb.c
@@ -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;
}