1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-01 20:32:13 +00:00

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.
This commit is contained in:
wm4 2014-07-25 14:28:14 +02:00
parent f24f960ec7
commit 18c432b83a
2 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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++) {