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 <[email protected]>
  • Loading branch information
cjihrig committed Dec 4, 2015
1 parent 5c6aac4 commit a9c0c65
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/env.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#include "env.h"
#include "env-inl.h"
#include "v8.h"
#include "unistd.h"

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

#include <stdio.h>

namespace node {
Expand Down

0 comments on commit a9c0c65

Please sign in to comment.