diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-23 21:57:24 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-23 21:57:24 +0000 |
commit | a936bd5c63e96535be85c965260fbd45db1a3c58 (patch) | |
tree | b5473b7c812598fede3f26f543a42581fde60311 /ext/socket/init.c | |
parent | 1946607ba33335f2aeccdddafca5d1cc109cce54 (diff) | |
download | ruby-a936bd5c63e96535be85c965260fbd45db1a3c58.tar.gz |
io.c (rb_gc_for_fd): wrapper for retrying FD creation
This simplifies callers and makes error handling more consistent
between our pipe, open, fdopen, and dup wrappers.
This adds missing ENOMEM handling as documented in the open(2),
pipe(2freebsd), and fdopen(3posix) manpages on my system.
We also avoid repeatedly accessing `errno` which is implemented
in TLS on GNU/Linux systems and more expensive to read than a
local variable.
We may export this in internal.h for ext/socket/* and dir.c, too.
* io.c (rb_gc_for_fd): new helper function
(ruby_dup): use rb_gc_for_fd
(rb_sysopen): ditto
(rb_fdopen): ditto
(rb_pipe): ditto
[ruby-core:71623] [Feature #11727]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/init.c')
0 files changed, 0 insertions, 0 deletions