summaryrefslogtreecommitdiffstats
path: root/input
diff options
context:
space:
mode:
authorwm4 <wm4@mplayer2.org>2012-03-16 18:57:23 +0100
committerwm4 <wm4@mplayer2.org>2012-03-16 19:14:44 +0100
commit6de8120822c2dd9c50ef23b4977421651396f1ae (patch)
tree11a977608cfc9f50cffbce4a879dd8e9b33b029c /input
parent0eb21226cbfdd200f2aea5d3a9db2cdbff4773a5 (diff)
parenta8168102668337f3c11619bea7e744fc245adff1 (diff)
downloadmpv-6de8120822c2dd9c50ef23b4977421651396f1ae.tar.bz2
mpv-6de8120822c2dd9c50ef23b4977421651396f1ae.tar.xz
Merge remote-tracking branch 'origin/master' into my_master
Conflicts: command.c mp_core.h mplayer.c screenshot.c
Diffstat (limited to 'input')
-rw-r--r--input/input.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/input/input.c b/input/input.c
index 1d973c3aa6..008c908634 100644
--- a/input/input.c
+++ b/input/input.c
@@ -31,6 +31,8 @@
#include <ctype.h>
#include <assert.h>
+#include "osdep/io.h"
+
#include "input.h"
#include "mp_fifo.h"
#include "keycodes.h"
@@ -1815,13 +1817,16 @@ struct input_ctx *mp_input_init(struct input_conf *input_conf)
#endif
if (input_conf->in_file) {
- struct stat st;
- int mode = O_RDONLY | O_NONBLOCK;
+ int mode = O_RDONLY;
+#ifndef __MINGW32__
// Use RDWR for FIFOs to ensure they stay open over multiple accesses.
- // Note that on Windows stat may fail for named pipes,
- // but due to how the API works, using RDONLY should be ok.
+ // Note that on Windows due to how the API works, using RDONLY should
+ // be ok.
+ struct stat st;
if (stat(input_conf->in_file, &st) == 0 && S_ISFIFO(st.st_mode))
- mode = O_RDWR | O_NONBLOCK;
+ mode = O_RDWR;
+ mode |= O_NONBLOCK;
+#endif
int in_file_fd = open(input_conf->in_file, mode);
if (in_file_fd >= 0)
mp_input_add_cmd_fd(ictx, in_file_fd, 1, NULL, close);