From 56c2f5702fc8baf70661d3788a1211abe2cb0ffc Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sat, 6 Oct 2018 16:17:17 -0400 Subject: [PATCH] src: reduce variable scope in node_trace_writer.cc PR-URL: https://github.com/nodejs/node/pull/23297 Reviewed-By: Anna Henningsen Reviewed-By: Joyee Cheung Reviewed-By: Refael Ackermann Reviewed-By: Gabriel Schulhof Reviewed-By: Trivikram Kamat Reviewed-By: Ruben Bridgewater Reviewed-By: James M Snell --- src/tracing/node_trace_writer.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/tracing/node_trace_writer.cc b/src/tracing/node_trace_writer.cc index a0382e587b3ad7..1d06c942332fcd 100644 --- a/src/tracing/node_trace_writer.cc +++ b/src/tracing/node_trace_writer.cc @@ -49,10 +49,8 @@ void NodeTraceWriter::WriteSuffix() { NodeTraceWriter::~NodeTraceWriter() { WriteSuffix(); uv_fs_t req; - int err; if (fd_ != -1) { - err = uv_fs_close(nullptr, &req, fd_, nullptr); - CHECK_EQ(err, 0); + CHECK_EQ(0, uv_fs_close(nullptr, &req, fd_, nullptr)); uv_fs_req_cleanup(&req); } uv_async_send(&exit_signal_);