Skip to content

Conversation

@zzzjim
Copy link
Contributor

@zzzjim zzzjim commented Nov 19, 2017

According to the fstat man page there is a bug
in fstat on OS X that fstat on a pipe.
The fstat() call had to be changed to a stat() call
in order to get the correct permissions.

Test cases have been modified to check the result
of uv_pipe_chmod to confirm the change actually worked.

@bzoz
Copy link
Member

bzoz commented Nov 20, 2017

src/unix/pipe.c Outdated
return r;
}

/* Unfortunately fstat on a pipe has a bug on OSX Darwin */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I don't think this comment provides enough information outside of the context of this PR. Perhaps at least say that stat is used instead of fstat due to a bug on macOS."

According to the fstat man page there is a bug
in fstat on OS X that fstat on a pipe.
The fstat() call had to be changed to a stat() call
in order to get the correct permissions.

Test cases have been modified to check the result
of uv_pipe_chmod to confirm the change actually worked.
@zzzjim
Copy link
Contributor Author

zzzjim commented Jan 18, 2018

I've fixed the comments for osx about fstat and stat.
pipe_chmod still doesn't work without this last change.

@bzoz
Copy link
Member

bzoz commented Jan 25, 2018

Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. @zzzjim could you rebase this.

@zzzjim zzzjim force-pushed the fix-pipe-chmod branch 2 times, most recently from 01d8d69 to f8268f0 Compare April 12, 2018 01:09
zzzjim added 3 commits April 11, 2018 18:13
According to the fstat man page there is a bug
in fstat on OS X that fstat on a pipe.
The fstat() call had to be changed to a stat() call
in order to get the correct permissions.

Test cases have been modified to check the result
of uv_pipe_chmod to confirm the change actually worked.
@zzzjim
Copy link
Contributor Author

zzzjim commented Apr 12, 2018

@cjihrig - rebased.

cjihrig pushed a commit to cjihrig/libuv that referenced this pull request Apr 12, 2018
According to its man page, there is a bug in fstat()
on macOS related to pipes. This commit replaces a
fstat() call in uv_pipe_chmod() with a stat() call in
order to get the correct permissions.

PR-URL: libuv#1635
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Santiago Gimeno <[email protected]>
@cjihrig
Copy link
Contributor

cjihrig commented Apr 12, 2018

Landed in 19855c0. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants