summaryrefslogtreecommitdiff
path: root/ext/pty/pty.c
AgeCommit message (Collapse)Author
2014-01-12ext: use rb_sprintf() and rb_vsprintf() with PRIsVALUEnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-05pty.c: check error of seteuidnobu
* ext/pty/pty.c (chfunc): check error of seteuid and return error message, to suppress unused-value warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-25* ext/pty/pty.c (get_device_once): FreeBSD 10-current and 9-stablenaruse
added O_CLOEXEC support to posix_openpt, so assume FreeBSD 9.2 or later supports it. http://www.freebsd.org/cgi/query-pr.cgi?pr=162374 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-21use rb_pid_t instead of pid_t.kazu
* process.c (rb_execarg_addopt, run_exec_pgroup): use rb_pid_t instead of pid_t. * ext/pty/pty.c (raise_from_check, pty_check): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-20* ext/pty/pty.c: Documentation for the PTY modulezzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-06* doc/pty/README: Remove static documentation filezzak
* ext/pty/pty.c: Add License to PTY module overview git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-22Supress warnings: unused variablesnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-22* process.c: use the name "eargp" for struct rb_execarg variablesakr
consistently except for saving process attributes. * io.c: ditto. * ext/pty/pty.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-20* process.c (rb_execarg_fixup): take a VALUE argument instead ofakr
struct rb_execarg. * internal.h (rb_execarg_fixup): follow the definition change. * io.c (pipe_open): follow rb_execarg_fixup change. * ext/pty/pty.c (establishShell): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-20* internal.h (struct rb_execarg) moved and renamed fromakr
struct rb_exec_arg in intern.h. * include/ruby/intern.h (struct rb_exec_arg): refer Data object which contains struct rb_execarg. * process.c: use struct rb_execarg instead of struct rb_exec_arg except functions declared in intern.h. (rb_exec_arg_addopt): extract a pointer to struct rb_execarg from struct rb_exec_arg. (rb_exec_arg_init): ditto. (rb_exec_arg_fixup): ditto. (rb_run_exec_options_err): ditto. (rb_run_exec_options): ditto. (rb_exec_err): ditto. (rb_exec): ditto. * io.c: use struct rb_execarg instead of struct rb_exec_arg. * ext/pty/pty.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-20* internal.h (rb_execarg_new): declared.akr
(rb_execarg_get): ditto. * process.c (mark_exec_arg): new function. (free_exec_arg): ditto. (memsize_exec_arg): ditto. (exec_arg_data_type): defined. (rb_execarg_new): new function. (rb_execarg_get): ditto. (rb_f_exec): use rb_execarg_new. (rb_spawn_internal): ditto. (rb_f_spawn): ditto. * io.c (pipe_open_v): use rb_execarg_new. (pipe_open_s): ditto. * ext/pty/pty.c (establishShell): use rb_execarg_new. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-12* include/ruby/intern.h (rb_exec_arg_init): deprecated.akr
(rb_exec_arg_addopt): ditto. (rb_exec_arg_fixup): ditto. (rb_run_exec_options): ditto. (rb_run_exec_options_err): ditto. * internal.h (rb_execarg_init): declared. (rb_execarg_addopt): ditto. (rb_execarg_fixup): ditto. (rb_execarg_run_options): ditto. * process.c: call rb_execarg_addopt, rb_execarg_fixup, rb_execarg_run_options, rb_execarg_init. (rb_execarg_addopt): renamed from rb_exec_arg_addopt. (rb_exec_arg_addopt): stub to call rb_execarg_addopt. (rb_execarg_init): renamed from rb_exec_arg_init. (rb_exec_arg_init): stub to call rb_execarg_init. (rb_execarg_fixup): renamed from rb_exec_arg_fixup. (rb_exec_arg_fixup): stub to call rb_execarg_fixup. (rb_execarg_run_options): renamed from rb_run_exec_options_err. (rb_run_exec_options_err): stub to call rb_execarg_run_options. (rb_run_exec_options): call rb_execarg_run_options. * io.c: call rb_execarg_addopt, rb_execarg_fixup, rb_execarg_run_options, rb_execarg_init. * ext/pty/pty.c (establishShell): call rb_execarg_init and rb_execarg_fixup. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10* process.c (rb_exec_async_signal_safe): exported.akr
* ext/pty/extconf.rb: modify $INCFLAGS to include internal.h * ext/pty/pty.c: include internal.h. (chfunc): don't call rb_thread_atfork_before_exec. use rb_exec_async_signal_safe instead of rb_f_exec. (establishShell): set up earg. use rb_fork_async_signal_safe instead of rb_fork_err. * internal.h (rb_exec_async_signal_safe): declared. (rb_fork_async_signal_safe): declared. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-08process.c, ext/pty/pty.c: status on errorsnobu
* process.c (rb_fork_err): determine status on errors. * ext/pty/pty.c (establishShell): reraise exception if something raised during sleep. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-08ext/pty/pty.c: status to protectnobu
* ext/pty/pty.c (establishShell): now needs status to protect from exceptions in rb_fork_err(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-23use RB_TYPE_P() instead of comparison of TYPE()nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-15* reduce UNREACHABLE.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-14* variable.c (trace_ev): Removed "not reached" comment as this line isdrbrain
reached. * variable.c (rb_obj_remove_instance_variable): Replaced "not reached" comment with the UNREACHABLE macro. * variable.c (rb_mod_const_missing): ditto. * variable.c (rb_mod_remove_cvar): ditto. * enum.c (first_i): ditto. * string.c (rb_str_aref): ditto. * string.c (str_byte_aref): ditto. * string.c (rb_to_id): ditto. * io.c (rb_io_fmode_modestr): ditto. * io.c (rb_io_oflags_modestr): ditto. * pack.c (num2i32): ditto. * vm_eval.c (rb_method_missing): ditto. * vm_eval.c (rb_f_throw): ditto. * dir.c (dir_read): ditto. * win32/win32.c (child_result): ditto. * struct.c (rb_struct_getmember): ditto. * struct.c (rb_struct_set): ditto. * struct.c (rb_struct_aref_id): ditto. * eval.c (rb_f_raise): ditto. * process.c (rb_f_exit_bang): ditto. * process.c (rb_f_exit): ditto. * process.c (rb_f_abort): ditto. * ext/-test-/iter/break.c (iter_break_value): ditto. * ext/pty/pty.c (pty_check): ditto. * ext/openssl/ossl_pkey.c (ossl_pkey_new): ditto. * ext/readline/readline.c (rb_remove_history): ditto. * ext/stringio/stringio.c (strio_unimpl): ditto. * numeric.c (num_sadded): ditto. * numeric.c (num_init_copy): ditto. * numeric.c (rb_num2ll): ditto. * numeric.c (rb_num2ull): ditto. * vm_insnhelper.c (call_cfunc): ditto. * ruby.c (opt_W_getter): ditto. * bignum.c (rb_big_coerce): ditto. * file.c (rb_f_test): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-15* io.c, thread.c, ext/pty/pty.c, ext/fiddle/closure.c: useakr
__linux__ macro for consistency. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-09add comment.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-08* ext/pty/pty.c (MasterDevice): define only when used.akr
(SlaveDevice): ditto. (deviceNo): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-08* ext/pty/pty.c (get_device_once): FreeBSD 8 supported O_CLOEXEC flagnaruse
for posix_openpt, but FreeBSD 9's posix_openpt doesn't support O_CLOEXEC and fails if specified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-08* ext/pty/pty.c (get_device_once): FreeBSD's posix_openpt doesn'tnaruse
support O_CLOEXEC and fails if specified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-31* include/ruby/intern.h (rb_fd_fix_cloexec): renamed fromakr
rb_fd_set_cloexec. * io.c: follow the above renaming. * ext/pty/pty.c: ditto. * ext/socket/init.c: ditto. * ext/socket/socket.c: ditto. * ext/socket/ancdata.c: ditto. * ext/socket/unixsocket.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-31* ext/pty/pty.c (get_device_once): use O_CLOEXEC for posix_openpt ifakr
available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-29* include/ruby/intern.h (rb_cloexec_dup): declared.akr
* io.c (rb_cloexec_dup): new function. (ruby_dup): use rb_cloexec_dup. * ext/pty/pty.c (pty_getpty): use rb_cloexec_dup. * ext/openssl/ossl_bio.c (ossl_obj2bio): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-29* process.c (ruby_setsid): use rb_cloexec_open.akr
(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
2011-10-24* ext/pty/pty.c (get_device_once): delay rb_fd_set_cloexec() untilakr
grantpt() on Solaris. grantpt() doesn't work with CLOEXEC on Solaris 10. reported by Naohisa GOTO. [ruby-dev:44688] [Bug #5475] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-22* include/ruby/intern.h (rb_fd_set_cloexec): declared.akr
* io.c (rb_fd_set_cloexec): new function. (ruby_dup): call rb_fd_set_cloexec to set close-on-exec flag. (rb_sysopen_internal): ditto. (rb_pipe): ditto. (io_reopen): ditto. (io_cntl): ditto. * process.c (rb_f_exec): change the default :close_others option to true. (rb_f_system): ditto. (move_fds_to_avoid_crash): call rb_fd_set_cloexec to set close-on-exec flag. (ruby_setsid): ditto. (rb_daemon): ditto. * thread_pthread.c (rb_thread_create_timer_thread): call rb_fd_set_cloexec to set close-on-exec flag. * 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/openssl/ossl_bio.c (ossl_obj2bio): ditto. * ext/socket/init.c (rsock_socket): ditto. (rsock_s_accept_nonblock): ditto. (rsock_s_accept): ditto. * ext/socket/socket.c (rsock_sock_s_socketpair): ditto. * ext/socket/ancdata.c (discard_cmsg): ditto. (make_io_for_unix_rights): ditto. * ext/socket/unixsocket.c (unix_recv_io): ditto. * ext/io/console/console.c (console_dev): ditto. [ruby-core:38140] [Feature #5041] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-14* ext/pty/pty.c (pty_check): should return nil until the childnobu
terminates or stops. [ruby-dev:44600] [Bug #2642] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-20* include/ruby/intern.h (rb_update_max_fd): declaration moved fromakr
internal.h. * file.c: ditto. * io.c: call rb_update_max_fd for each new fds. * process.c: ditto. * random.c: ditto. * ruby.c: ditto. * ext/io/console/console.c: ditto. * ext/openssl/ossl_bio.c: ditto. * ext/pty/pty.c: ditto. * ext/socket/init.c: ditto. * ext/socket/socket.c: ditto. * ext/socket/ancdata.c: ditto. * ext/socket/unixsocket.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-31 * ext/pty/pty.c (pty_check): Restore "not reached" comment.drbrain
[Ruby 1.9 - Bug #4756] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-22* ext: remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-22 * ext/pty/pty.c: Improve documentaton. Patch by David Copeland.drbrain
[Ruby 1.9 - Bug #4756] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-09* ext/pty/pty.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-06* ext/pty/pty.c (chfunc): suppress a warning.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25 * ext/pty/pty.c (chfunc): Added rb_thread_atfork_before_exec().kosaki
We must reinitialize GVL when new process creation. Otherwise we may meet an insane deadlock. [Bug #4121][ruby-dev:42686] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-02* ext/pty/pty.c (chfunc): pass through exceptions.nobu
* io.c (rb_io_bufwrite, rb_io_bufread): added. * process.c (rb_fork_err): protect from exceptions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-02* ext/pty/pty.c (chfunc): restore errno from SystemCallError andnobu
propagate proper exception to the parent. [ruby-dev:41965] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-13* ext/pty/pty.c (establishShell): chfunc must not raise anynobu
exceptions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-23* NEWS (ptr): new method and deprecated methods. [ruby-dev:41681]nobu
* ext/pty/{README,README.ja}: ditto. * ext/pty/pty.c (pty_check): add rdoc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-09update doc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-09revert previous doc. change.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-08update doc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-01* ext/pty/pty.c (pty_open): refine the path for master IO.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-28* ext/pty/pty.c (get_device_once): raise on error when fail isnobu
non-zero. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-25* ext/pty/pty.c (pty_check): needs WNOHANG to poll, return $?, andnobu
call raise_from_check() with pid_t. [ruby-dev:40141] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-26* ext/pty/pty.c (pty_getpty): check dup failure.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-22update rdoc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-05* ext/pty/pty.c (chfunc): type fixed.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e