Skip to content

fix usage of fcntl(..., F_GETFL, ...) #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 12, 2016
Merged

fix usage of fcntl(..., F_GETFL, ...) #17

merged 1 commit into from
Feb 12, 2016

Conversation

tonycoz
Copy link
Contributor

@tonycoz tonycoz commented Feb 3, 2016

Until about 5 minutes ago (at least in bleadperl), the documentation for fcntl() had included an incorrect example:

use Fcntl;
fcntl($filehandle, F_GETFL, $packed_return_buffer)
    or die "can't fcntl F_GETFL: $!";

This is incorect, fcntl() with the FUNCTION set to F_GETFL returns the value, it doesn't store the result in the SCALAR parameter.

Unfortunately this incorrect usage is reflected in IPC::Cmd, this pull request fixes these calls.

This worked despite the incorrect code because F_SETFL ignores most of the possible flags that F_GETFL returns, eg. F_SETFL won't modify F_RDWR.

bingos added a commit that referenced this pull request Feb 12, 2016
fix usage of fcntl(..., F_GETFL, ...)
@bingos bingos merged commit 0a283c2 into jib:master Feb 12, 2016
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.

2 participants