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 <cjihrig@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com>
This commit is contained in:
parent
213e681acf
commit
42ebae18d6
@ -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");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user