summaryrefslogtreecommitdiffstats
path: root/stream/stream_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'stream/stream_file.c')
-rw-r--r--stream/stream_file.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/stream/stream_file.c b/stream/stream_file.c
index b638fdddf0..e72355d387 100644
--- a/stream/stream_file.c
+++ b/stream/stream_file.c
@@ -101,11 +101,11 @@ static int open_f(stream_t *stream, int mode)
};
stream->priv = priv;
- mode_t m = 0;
+ mode_t m = O_CLOEXEC;
if (mode == STREAM_READ)
- m = O_RDONLY;
+ m |= O_RDONLY;
else if (mode == STREAM_WRITE)
- m = O_RDWR | O_CREAT | O_TRUNC;
+ m |= O_RDWR | O_CREAT | O_TRUNC;
else {
mp_msg(MSGT_OPEN, MSGL_ERR, "[file] Unknown open mode %d\n", mode);
return STREAM_UNSUPPORTED;