Skip to content

Commit

Permalink
src: define getpid() based on OS
Browse files Browse the repository at this point in the history
94b9948 added unistd.h to src/env.cc in order to use getpid().
However, this doesn't exist on Windows. This commit conditionally
defines getpid() based on the OS.

Fixes: #4145
PR-URL: #4146
Reviewed-By: Brian White <mscdex@mscdex.net>
  • Loading branch information
cjihrig authored and rvagg committed Dec 5, 2015
1 parent fd5ed68 commit 458facd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/env.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#include "env.h"
#include "env-inl.h"
#include "v8.h"

#if defined(_MSC_VER)
#define getpid GetCurrentProcessId
#else
#include <unistd.h>
#endif

#include <stdio.h>

namespace node {
Expand Down

0 comments on commit 458facd

Please sign in to comment.