Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
  • Loading branch information
RaisinTen committed Jan 13, 2021
commit 3e7ef4b8878f0a669208597aa5171c0a27a53ed2
4 changes: 3 additions & 1 deletion test/cctest/test_environment.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "node_buffer.h"
#include "node_internals.h"
#include "libplatform/libplatform.h"
#include "util.h"

#include <string>
#include "gtest/gtest.h"
Expand All @@ -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;
Expand Down Expand Up @@ -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() {
Expand Down