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: nodejs#4145
PR-URL: nodejs#4146
Reviewed-By: Brian White <mscdex@mscdex.net>
  • Loading branch information
cjihrig authored and Michael Scovetta committed Apr 2, 2016
1 parent bc6663d commit 8018a25
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 8018a25

Please sign in to comment.