fix: ignore unused freopen result (#15884)

This commit is contained in:
Shelley Vohr 2018-11-29 09:36:08 -08:00 committed by GitHub
parent 753fb31c54
commit 165d168ee5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -69,11 +69,11 @@ void FixStdioStreams() {
// For details see https://github.com/libuv/libuv/issues/2062
struct stat st;
if (fstat(STDIN_FILENO, &st) < 0 && errno == EBADF)
freopen("/dev/null", "r", stdin);
ignore_result(freopen("/dev/null", "r", stdin));
if (fstat(STDOUT_FILENO, &st) < 0 && errno == EBADF)
freopen("/dev/null", "w", stdout);
ignore_result(freopen("/dev/null", "w", stdout));
if (fstat(STDERR_FILENO, &st) < 0 && errno == EBADF)
freopen("/dev/null", "w", stderr);
ignore_result(freopen("/dev/null", "w", stderr));
}
#endif