Skip to content
Permalink
Browse files

src: use macro instead of magic number for fd

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 9, 2019
1 parent 655c90b commit 845a6214f842f3a5220f4bf4f209c0f5b25d48b5
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/node_report_utils.cc
@@ -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;
}
}
}

0 comments on commit 845a621

Please sign in to comment.
You can’t perform that action at this time.