Skip to content

Commit 845a621

Browse files
gengjiawenrefack
authored andcommitted
src: use macro instead of magic number for fd
PR-URL: #27152 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 655c90b commit 845a621

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/node_report_utils.cc

+5-3
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,17 @@ void WalkHandle(uv_handle_t* h, void* arg) {
192192
if (rc == 0) {
193193
writer->json_keyvalue("fd", static_cast<int>(fd_v));
194194
switch (fd_v) {
195-
case 0:
195+
case STDIN_FILENO:
196196
writer->json_keyvalue("stdio", "stdin");
197197
break;
198-
case 1:
198+
case STDOUT_FILENO:
199199
writer->json_keyvalue("stdio", "stdout");
200200
break;
201-
case 2:
201+
case STDERR_FILENO:
202202
writer->json_keyvalue("stdio", "stderr");
203203
break;
204+
default:
205+
break;
204206
}
205207
}
206208
}

0 commit comments

Comments
 (0)