|
99 | 99 | #if defined(_MSC_VER) |
100 | 100 | #include <direct.h> |
101 | 101 | #include <io.h> |
102 | | -#define getpid GetCurrentProcessId |
103 | 102 | #define umask _umask |
104 | 103 | typedef int mode_t; |
105 | 104 | #else |
@@ -1659,13 +1658,8 @@ NO_RETURN void Assert(const char* const (*args)[4]) { |
1659 | 1658 | if (uv_exepath(exepath, &exepath_size)) |
1660 | 1659 | snprintf(exepath, sizeof(exepath), "node"); |
1661 | 1660 |
|
1662 | | - char pid[12] = {0}; |
1663 | | -#ifndef _WIN32 |
1664 | | - snprintf(pid, sizeof(pid), "[%u]", getpid()); |
1665 | | -#endif |
1666 | | - |
1667 | | - fprintf(stderr, "%s%s: %s:%s:%s%s Assertion `%s' failed.\n", |
1668 | | - exepath, pid, filename, linenum, |
| 1661 | + fprintf(stderr, "%s[%u]: %s:%s:%s%s Assertion `%s' failed.\n", |
| 1662 | + exepath, GetProcessId(), filename, linenum, |
1669 | 1663 | function, *function ? ":" : "", message); |
1670 | 1664 | fflush(stderr); |
1671 | 1665 |
|
@@ -3197,7 +3191,8 @@ void SetupProcessObject(Environment* env, |
3197 | 3191 | process_env_template->NewInstance(env->context()).ToLocalChecked(); |
3198 | 3192 | process->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "env"), process_env); |
3199 | 3193 |
|
3200 | | - READONLY_PROPERTY(process, "pid", Integer::New(env->isolate(), getpid())); |
| 3194 | + READONLY_PROPERTY(process, "pid", |
| 3195 | + Integer::New(env->isolate(), GetProcessId())); |
3201 | 3196 | READONLY_PROPERTY(process, "features", GetFeatures(env)); |
3202 | 3197 |
|
3203 | 3198 | CHECK(process->SetAccessor(env->context(), |
|
0 commit comments