From 3d20415871bc39509a4890d13a641ff31261059b Mon Sep 17 00:00:00 2001 From: raisinten Date: Fri, 8 Jan 2021 18:27:10 +0530 Subject: [PATCH] test: fix warning in test_environment.cc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` warning log: ../test/cctest/test_environment.cc: In constructor \ ‘RedirectStdErr::RedirectStdErr(const char*)’: ../test/cctest/test_environment.cc:77:12: warning: \ ignoring return value of ‘FILE* freopen(const char*, \ const char*, FILE*)’, declared with attribute warn_unused_result [-Wunused-result] freopen(filename_, "w", stderr); ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ ``` PR-URL: https://github.com/nodejs/node/pull/36846 Reviewed-By: Antoine du Hamel Reviewed-By: James M Snell --- test/cctest/test_environment.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/cctest/test_environment.cc b/test/cctest/test_environment.cc index 862dfd5780868a..e9c81dc97ddbf1 100644 --- a/test/cctest/test_environment.cc +++ b/test/cctest/test_environment.cc @@ -1,6 +1,7 @@ #include "node_buffer.h" #include "node_internals.h" #include "libplatform/libplatform.h" +#include "util.h" #include #include "gtest/gtest.h" @@ -10,6 +11,7 @@ using node::AtExit; using node::RunAtExit; +using node::USE; static bool called_cb_1 = false; static bool called_cb_2 = false; @@ -74,7 +76,7 @@ class RedirectStdErr { fflush(stderr); fgetpos(stderr, &pos_); fd_ = dup(fileno(stderr)); - freopen(filename_, "w", stderr); + USE(freopen(filename_, "w", stderr)); } ~RedirectStdErr() {