★ wanayoo — archive 1999 https://github.com/nodejs/node/commit/c45623a548Nouvelle recherche | Portail wanayoo
Skip to content
Permalink
Browse files
src: avoid unnecessarily formatting a warning
ProcessEmitWarning will already format the message, there is no
need to call snprintf here.

PR-URL: #21832
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
tniessen authored and targos committed Jul 19, 2018
1 parent 0f70017 commit c45623a548812463927d7408c1167cac21c7f23c
Showing with 3 additions and 5 deletions.
  1. +3 −5 src/node_file.cc
@@ -172,13 +172,11 @@ inline void FileHandle::Close() {
// to notify that the file descriptor was gc'd. We want to be noisy about
// this because not explicitly closing the FileHandle is a bug.
env()->SetUnrefImmediate([](Environment* env, void* data) {
char msg[70];
err_detail* detail = static_cast<err_detail*>(data);
snprintf(msg, arraysize(msg),
"Closing file descriptor %d on garbage collection",
detail->fd);
ProcessEmitWarning(env,
"Closing file descriptor %d on garbage collection",
detail->fd);
delete detail;
ProcessEmitWarning(env, msg);
}, detail);
}

0 comments on commit c45623a

Please sign in to comment.