From 42ebae18d6635251aeecff135ba506ca96881e8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Thu, 10 Mar 2016 11:59:48 +0100 Subject: [PATCH] linux: fix error checking in uv__open_file uv__open_cloexec returns either the fd or a libuv error, which is -errno on Unix, not -1. PR-URL: https://github.com/libuv/libuv/pull/760 Reviewed-By: Colin Ihrig Reviewed-By: Fedor Indutny --- src/unix/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unix/core.c b/src/unix/core.c index 5a8987e7..51318be8 100644 --- a/src/unix/core.c +++ b/src/unix/core.c @@ -433,7 +433,7 @@ FILE* uv__open_file(const char* path) { FILE* fp; fd = uv__open_cloexec(path, O_RDONLY); - if (fd == -1) + if (fd < 0) return NULL; fp = fdopen(fd, "r");