Skip to content

Commit

Permalink
src: use macro instead of magic number for fd
Browse files Browse the repository at this point in the history
PR-URL: #27152
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
gengjiawen authored and refack committed Apr 11, 2019
1 parent 655c90b commit 845a621
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/node_report_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,17 @@ void WalkHandle(uv_handle_t* h, void* arg) {
if (rc == 0) {
writer->json_keyvalue("fd", static_cast<int>(fd_v));
switch (fd_v) {
case 0:
case STDIN_FILENO:
writer->json_keyvalue("stdio", "stdin");
break;
case 1:
case STDOUT_FILENO:
writer->json_keyvalue("stdio", "stdout");
break;
case 2:
case STDERR_FILENO:
writer->json_keyvalue("stdio", "stderr");
break;
default:
break;
}
}
}
Expand Down

0 comments on commit 845a621

Please sign in to comment.