diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-10-29 04:01:54 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-10-29 04:01:54 +0000 |
commit | da74bc75523ef4054030e5f3cf4aac3e9bfe8715 (patch) | |
tree | 3b197501d1fb7f83ebc91a060e00dfc1d531e62c /ext/io | |
parent | 3ae3cd741d4ac85e2cd53c588318afb582412fd9 (diff) | |
download | ruby-da74bc75523ef4054030e5f3cf4aac3e9bfe8715.tar.gz |
* process.c (ruby_setsid): use rb_cloexec_open.
(rb_daemon): ditto.
* ruby.c (load_file_internal): ditto.
* file.c (rb_file_s_truncate): ditto.
(file_load_ok): ditto.
* random.c (fill_random_seed): ditto.
* ext/pty/pty.c (chfunc): ditto.
(get_device_once): ditto.
* ext/io/console/console.c (console_dev): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/io')
-rw-r--r-- | ext/io/console/console.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/io/console/console.c b/ext/io/console/console.c index 72f507210c..1f87a31002 100644 --- a/ext/io/console/console.c +++ b/ext/io/console/console.c @@ -562,21 +562,21 @@ console_dev(VALUE klass) int fd; #ifdef CONSOLE_DEVICE_FOR_WRITING - fd = open(CONSOLE_DEVICE_FOR_WRITING, O_WRONLY); + fd = rb_cloexec_open(CONSOLE_DEVICE_FOR_WRITING, O_WRONLY, 0); if (fd < 0) return Qnil; - rb_fd_set_cloexec(fd); + rb_update_max_fd(fd); args[1] = INT2FIX(O_WRONLY); args[0] = INT2NUM(fd); out = rb_class_new_instance(2, args, klass); #endif - fd = open(CONSOLE_DEVICE_FOR_READING, O_RDWR); + fd = rb_cloexec_open(CONSOLE_DEVICE_FOR_READING, O_RDWR, 0); if (fd < 0) { #ifdef CONSOLE_DEVICE_FOR_WRITING rb_io_close(out); #endif return Qnil; } - rb_fd_set_cloexec(fd); + rb_update_max_fd(fd); args[1] = INT2FIX(O_RDWR); args[0] = INT2NUM(fd); con = rb_class_new_instance(2, args, klass); |