Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content
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

No expect of EAGAIN from sysread #9

Merged
merged 1 commit into from
Feb 26, 2017
Merged

No expect of EAGAIN from sysread #9

merged 1 commit into from
Feb 26, 2017

Conversation

sorah
Copy link
Contributor

@sorah sorah commented Feb 26, 2017

No description provided.

@sorah
Copy link
Contributor Author

sorah commented Feb 26, 2017

oops, submitted without writing description. IO#sysread doesn't raise Errno::EAGAIN, because it's a blocking method. This sysread loop could infinitely get blocked, so remove the loop and use select(2) every time to check fd states.

IO#sysread doesn't raise EAGAIN, it's a blocking method. Use select(2)
every time to check fd states before read(2). The removed loop could get
blocked infinitely at a second run.
sorah added a commit to sorah/sorah-overlay that referenced this pull request Feb 26, 2017
@k0kubun
Copy link
Collaborator

k0kubun commented Feb 26, 2017

Errno::EAGAIN was originally for read_nonblock #7. And I agree that now the rescue is obsolete and loop should be omitted. Thanks.

@k0kubun k0kubun merged commit b7480b6 into mrbgems:master Feb 26, 2017
@sorah
Copy link
Contributor Author

sorah commented Feb 26, 2017

oh, I see.

@eagletmt let me know if I miss something concerns.

@sorah sorah deleted the fixbuf branch February 26, 2017 23:13
@sorah sorah restored the fixbuf branch February 26, 2017 23:14
@eagletmt
Copy link
Contributor

LGTM

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.

3 participants