diff options
Diffstat (limited to 'src/util.cc')
-rw-r--r-- | src/util.cc | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/util.cc b/src/util.cc index 2aa9fb026e..77824acb03 100644 --- a/src/util.cc +++ b/src/util.cc @@ -22,16 +22,9 @@ #include "string_bytes.h" #include "node_buffer.h" #include "node_internals.h" +#include "uv.h" #include <stdio.h> -#ifdef __POSIX__ -#include <unistd.h> // getpid() -#endif - -#ifdef _MSC_VER -#include <windows.h> // GetCurrentProcessId() -#endif - namespace node { using v8::Isolate; @@ -122,15 +115,7 @@ std::string GetHumanReadableProcessName() { void GetHumanReadableProcessName(char (*name)[1024]) { char title[1024] = "Node.js"; uv_get_process_title(title, sizeof(title)); - snprintf(*name, sizeof(*name), "%s[%u]", title, GetProcessId()); -} - -uint32_t GetProcessId() { -#ifdef _WIN32 - return GetCurrentProcessId(); -#else - return getpid(); -#endif + snprintf(*name, sizeof(*name), "%s[%u]", title, uv_os_getpid()); } } // namespace node |