Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c45623a

Browse filesBrowse files
tniessentargos
authored andcommitted
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>
1 parent 0f70017 commit c45623a
Copy full SHA for c45623a

File tree

Expand file treeCollapse file tree

1 file changed

+3
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-5
lines changed
Open diff view settings
Collapse file

‎src/node_file.cc‎

Copy file name to clipboardExpand all lines: src/node_file.cc
+3-5Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,11 @@ inline void FileHandle::Close() {
172172
// to notify that the file descriptor was gc'd. We want to be noisy about
173173
// this because not explicitly closing the FileHandle is a bug.
174174
env()->SetUnrefImmediate([](Environment* env, void* data) {
175-
char msg[70];
176175
err_detail* detail = static_cast<err_detail*>(data);
177-
snprintf(msg, arraysize(msg),
178-
"Closing file descriptor %d on garbage collection",
179-
detail->fd);
176+
ProcessEmitWarning(env,
177+
"Closing file descriptor %d on garbage collection",
178+
detail->fd);
180179
delete detail;
181-
ProcessEmitWarning(env, msg);
182180
}, detail);
183181
}
184182

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.