diff options
author | wm4 <wm4@nowhere> | 2014-07-25 14:28:14 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-07-25 14:32:45 +0200 |
commit | 18c432b83a23181b81360d2f622bbb0c91fdb36d (patch) | |
tree | 78db6f197cc28e6dab8a4c8c521a3e60fc2ffc60 | |
parent | f24f960ec78552da3d0b143c4fb88a732e8e9e11 (diff) | |
download | mpv-18c432b83a23181b81360d2f622bbb0c91fdb36d.tar.bz2 mpv-18c432b83a23181b81360d2f622bbb0c91fdb36d.tar.xz |
osdep: don't assume errno is positive
Apparently this is not necessarily the case, so just drop the silly idea
that depended on this assumption.
-rw-r--r-- | input/input.c | 2 | ||||
-rw-r--r-- | osdep/io.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/input/input.c b/input/input.c index 9f2567d478..c035187126 100644 --- a/input/input.c +++ b/input/input.c @@ -1521,7 +1521,7 @@ struct input_ctx *mp_input_init(struct mpv_global *global) #ifndef __MINGW32__ int ret = mp_make_wakeup_pipe(ictx->wakeup_pipe); if (ret < 0) - MP_ERR(ictx, "Failed to initialize wakeup pipe: %s\n", strerror(-ret)); + MP_ERR(ictx, "Failed to initialize wakeup pipe.\n"); else mp_input_add_fd(ictx, ictx->wakeup_pipe[0], true, NULL, read_wakeup, NULL, NULL); diff --git a/osdep/io.c b/osdep/io.c index 27235e092c..8423a6beff 100644 --- a/osdep/io.c +++ b/osdep/io.c @@ -46,7 +46,7 @@ bool mp_set_cloexec(int fd) int mp_make_wakeup_pipe(int pipes[2]) { pipes[0] = pipes[1] = -1; - return -ENOSYS; + return -1; } #else // create a pipe, and set it to non-blocking (and also set FD_CLOEXEC) @@ -54,7 +54,7 @@ int mp_make_wakeup_pipe(int pipes[2]) { if (pipe(pipes) != 0) { pipes[0] = pipes[1] = -1; - return -errno; + return -1; } for (int i = 0; i < 2; i++) { |