diff options
author | wm4 <wm4@nowhere> | 2016-07-21 15:14:37 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-07-21 15:18:32 +0200 |
commit | 16d276308acb88c607d832f743d7d75d8bf9e420 (patch) | |
tree | 81a7bfabe1318efe6f30ba631cb34a3172e299ff /video/out/x11_common.c | |
parent | b4acfcc8aae49e0d0cca03d8abe3f7ed8e7279ff (diff) | |
download | mpv-16d276308acb88c607d832f743d7d75d8bf9e420.tar.bz2 mpv-16d276308acb88c607d832f743d7d75d8bf9e420.tar.xz |
x11, wayland: do not accidentally close FD 0
Both backends have code to close each FD of their wakeup_pipe array.
This array is default-initialized with 0, which means if the backends
exit before the wakeup pipe is created (e.g. when probing), they would
close FD 0.
Initialize the FDs with -1. Then we call close(-1) in these situations,
which is perfectly allowed and has no bad consequences.
Diffstat (limited to 'video/out/x11_common.c')
-rw-r--r-- | video/out/x11_common.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c index 2f35b6a4b8..b0082086bb 100644 --- a/video/out/x11_common.c +++ b/video/out/x11_common.c @@ -543,6 +543,7 @@ int vo_x11_init(struct vo *vo) .input_ctx = vo->input_ctx, .screensaver_enabled = true, .xrandr_event = -1, + .wakeup_pipe = {-1, -1}, }; vo->x11 = x11; |