Skip to content

Commit 3d20415

Browse files
RaisinTenruyadorno
authored andcommitted
test: fix warning in test_environment.cc
``` 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: #36846 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent e285a7a commit 3d20415

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/cctest/test_environment.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "node_buffer.h"
22
#include "node_internals.h"
33
#include "libplatform/libplatform.h"
4+
#include "util.h"
45

56
#include <string>
67
#include "gtest/gtest.h"
@@ -10,6 +11,7 @@
1011

1112
using node::AtExit;
1213
using node::RunAtExit;
14+
using node::USE;
1315

1416
static bool called_cb_1 = false;
1517
static bool called_cb_2 = false;
@@ -74,7 +76,7 @@ class RedirectStdErr {
7476
fflush(stderr);
7577
fgetpos(stderr, &pos_);
7678
fd_ = dup(fileno(stderr));
77-
freopen(filename_, "w", stderr);
79+
USE(freopen(filename_, "w", stderr));
7880
}
7981

8082
~RedirectStdErr() {

0 commit comments

Comments
 (0)