Skip to content

src: define getpid() based on OS - #4146

Merged
cjihrig merged 0 commit into
nodejs:masterfrom
cjihrig:4145
Dec 4, 2015
Merged

src: define getpid() based on OS#4146
cjihrig merged 0 commit into
nodejs:masterfrom
cjihrig:4145

Conversation

@cjihrig

Copy link
Copy Markdown
Contributor

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.

Closes#4145
R=@mscdex

@mscdex

Copy link
Copy Markdown
Contributor

I believe we can forgo including process.h on Windows and just alias getpid to GetCurrentProcessId instead, which shouldn't require any additional includes.

@cjihrig

Copy link
Copy Markdown
ContributorAuthor

I think you're right. Updating.

@cjihrig

Copy link
Copy Markdown
ContributorAuthor

Updated.

@cjihrig

Copy link
Copy Markdown
ContributorAuthor

@cjihrig

Copy link
Copy Markdown
ContributorAuthor

Only CI failures are known flakey tests.

@mscdex

Copy link
Copy Markdown
Contributor

LGTM

@cjihrigcjihrig closed this Dec 4, 2015
cjihrig added a commit to cjihrig/node that referenced this pull request Dec 4, 2015
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>
@cjihrig
cjihrig deleted the 4145 branch December 4, 2015 02:25
@cjihrig
cjihrig merged commit a9c0c65 into nodejs:masterDec 4, 2015
@cjihrig

Copy link
Copy Markdown
ContributorAuthor

Thanks for the review. Landing this more quickly than normal since the Windows CI was borked.

@rvagg

rvagg commented Dec 5, 2015

Copy link
Copy Markdown
Member

commits missing again, perhaps this is what github is doing now if you don't update your PR with the latest version of the commits and delete the branch?

cjihrig added a commit that referenced this pull request Dec 5, 2015
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>
@rvaggrvagg mentioned this pull request Dec 17, 2015
@jasnelljasnell added os Issues and PRs related to the os subsystem. lib / src Issues and PRs related to general changes in the lib or src directory. lts-watch-v4.x and removed os Issues and PRs related to the os subsystem. labels Dec 17, 2015
@MylesBorins

Copy link
Copy Markdown
Contributor

94b9948 was semver major so I do not believe this patch should be backported. @jasnell feel free to modify.

scovetta pushed a commit to scovetta/node that referenced this pull request Apr 2, 2016
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>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lib / srcIssues and PRs related to general changes in the lib or src directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@cjihrig@mscdex@rvagg@MylesBorins@jasnell