nobu
57fb219905
* reduce UNREACHABLE.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-15 00:06:13 +00:00
drbrain
e95f7ea80d
* variable.c (trace_ev): Removed "not reached" comment as this line is
...
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
2012-04-14 00:36:26 +00:00
akr
3d25acdccc
* io.c, thread.c, ext/pty/pty.c, ext/fiddle/closure.c: use
...
__linux__ macro for consistency.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-15 11:09:47 +00:00
akr
3f289d9237
add comment.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-09 13:26:06 +00:00
akr
c2c0707949
* ext/pty/pty.c (MasterDevice): define only when used.
...
(SlaveDevice): ditto.
(deviceNo): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-08 10:04:32 +00:00
naruse
452bf3b9c9
* ext/pty/pty.c (get_device_once): FreeBSD 8 supported O_CLOEXEC flag
...
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 08:26:00 +00:00
naruse
ce19ae0ef0
* ext/pty/pty.c (get_device_once): FreeBSD's posix_openpt doesn't
...
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-11-08 02:03:57 +00:00
akr
1a70dfe6f4
* include/ruby/intern.h (rb_fd_fix_cloexec): renamed from
...
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 12:49:16 +00:00
akr
92a8bfacd9
* ext/pty/pty.c (get_device_once): use O_CLOEXEC for posix_openpt if
...
available.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-31 03:39:01 +00:00
akr
4ae2b92576
* include/ruby/intern.h (rb_cloexec_dup): declared.
...
* 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 11:02:32 +00:00
akr
da74bc7552
* 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
2011-10-29 04:01:54 +00:00
akr
5153fd2a5e
* ext/pty/pty.c (get_device_once): delay rb_fd_set_cloexec() until
...
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-24 13:40:13 +00:00
akr
b574a4d4a1
* include/ruby/intern.h (rb_fd_set_cloexec): declared.
...
* 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-22 09:58:15 +00:00
nobu
039f12b5bb
* ext/pty/pty.c (pty_check): should return nil until the child
...
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-10-14 03:14:00 +00:00
drbrain
ca96541149
* ext/pathname/lib/pathname.rb: Fix typos and grammar mistakes. Patch
...
by Luke Gruber. [#5203 ]
* ext/pty/lib/expect.rb: ditto
* lib/mathn.rb: ditto
* lib/net/http.rb: ditto
* lib/open-uri.rb: ditto
* lib/ostruct.rb: ditto
* lib/tempfile.rb: ditto
* lib/thread.rb: ditto
* lib/weakref.rb: ditto
* sample/webrick/httpproxy.rb: ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-26 22:22:37 +00:00
akr
b41ccc4a9c
* include/ruby/intern.h (rb_update_max_fd): declaration moved from
...
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-07-20 13:26:10 +00:00
drbrain
161cdee265
* ext/pty/pty.c (pty_check): Restore "not reached" comment.
...
[Ruby 1.9 - Bug #4756 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-31 22:27:35 +00:00
nobu
0d6d23b25d
* ext: remove trailing spaces.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-22 09:26:02 +00:00
drbrain
87dbea7bbf
* ext/pty/pty.c: Improve documentaton. Patch by David Copeland.
...
[Ruby 1.9 - Bug #4756 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-22 02:45:12 +00:00
nobu
3a47cf3395
* remove trailing spaces.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-15 11:55:52 +00:00
akr
2cc0240078
* ext/pty/pty.c: parenthesize macro arguments.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-09 14:12:02 +00:00
nobu
088474a20d
* ext/pty/pty.c (chfunc): suppress a warning.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-06 05:38:11 +00:00
kosaki
402402741d
* ext/pty/pty.c (chfunc): Added rb_thread_atfork_before_exec().
...
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-12-25 05:31:04 +00:00
nobu
aa5c05b8ba
* ext/pty/pty.c (chfunc): pass through exceptions.
...
* 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 21:40:55 +00:00
nobu
185e9705ab
* ext/pty/pty.c (chfunc): restore errno from SystemCallError and
...
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-09-02 21:14:51 +00:00
nobu
c53664c84d
.cvsignore: have not been used already. [Bug #3468 ]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-07 05:43:21 +00:00
nobu
9afb0f0837
* ext/pty/pty.c (establishShell): chfunc must not raise any
...
exceptions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-13 12:01:45 +00:00
nobu
80684e9c09
* ext/pty: moved documents and samples to the appropriate places.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-23 08:25:12 +00:00
nobu
c7d001465c
* NEWS (ptr): new method and deprecated methods. [ruby-dev:41681]
...
* 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-06-23 08:12:54 +00:00
akr
cb61fcb988
update doc.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-09 16:32:52 +00:00
akr
c8892037c7
revert previous doc. change.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-09 00:36:38 +00:00
akr
f491696f4b
update doc.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-08 08:08:29 +00:00
mame
5869de449f
* ext/pty/lib/expect.rb: preserve buffer read, instead of discard.
...
based on a patch from Luiz Angelo Daros de Luca in
[ruby-core:23464].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-09 15:07:34 +00:00
mame
d124dcf4eb
* ext/pty/lib/expect.rb: raise an error when argument is unexpected
...
type. based on a patch from Luiz Angelo Daros de Luca in
[ruby-core:23464].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-09 15:04:54 +00:00
mame
bd623a0915
* ext/pty/lib/expect.rb: add rdoc. based on a patch from Luiz Angelo
...
Daros de Luca in [ruby-core:23464].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-09 15:04:40 +00:00
akr
e1c33162cf
* ext/pty/pty.c (pty_open): refine the path for master IO.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-01 14:28:04 +00:00
nobu
deaba5567d
* ext/pty/pty.c (get_device_once): raise on error when fail is
...
non-zero.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-28 12:32:39 +00:00
nobu
b148948982
* ext/pty/pty.c (pty_check): needs WNOHANG to poll, return $?, and
...
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
2010-01-25 08:47:04 +00:00
akr
c86115e996
* ext/pty/pty.c (pty_getpty): check dup failure.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-26 13:01:16 +00:00
akr
1d9f6c92b7
update rdoc.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-22 12:32:30 +00:00
nobu
287a34ae0d
* {ext,lib,test}/**/*.rb: removed trailing spaces.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-06 03:56:38 +00:00
akr
1bd6111488
* ext/pty/pty.c (chfunc): type fixed.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-05 22:53:44 +00:00
akr
74063bf4d3
* include/ruby/intern.h (rb_run_exec_options_err): renamed from
...
rb_run_exec_options.
(rb_exec_err): renamed from rb_exec.
(rb_fork_err): renamed from rb_fork.
(rb_spawn_err): renamed from rb_spawn.
(rb_run_exec_options): declared with 1.9.1 compatible signature.
(rb_exec): ditto.
(rb_fork): ditto.
(rb_spawn): ditto.
* process.c (rb_run_exec_options_err): renamed from
rb_run_exec_options.
(rb_exec_err): renamed from rb_exec.
(rb_fork_err): renamed from rb_fork.
(rb_spawn_err): renamed from rb_spawn.
(rb_run_exec_options): defined.
(rb_exec): ditto.
(rb_fork): ditto.
(rb_spawn): ditto.
* io.c: follow above change.
* ext/pty/pty.c: follow above change.
[ruby-dev:37893]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-05 11:33:19 +00:00
akr
423bbf80d5
* process.c (rb_fork): propagete an error message from child to parent.
...
(rb_f_exec): show details of error in child process on
exception.
(save_redirect_fd): add error message arguments.
(run_exec_dup2): ditto.
(run_exec_close): ditto.
(run_exec_open): ditto.
(run_exec_dup2_child): ditto.
(run_exec_pgroup): ditto.
(run_exec_rlimit): ditto.
(rb_run_exec_options): ditto.
(rb_exec): ditto.
(rb_exec_atfork): ditto.
(rb_spawn_internal): ditto.
(rb_spawn): ditto.
(rb_f_system): follow arguments change.
(proc_daemon): ditto.
(rb_f_spawn): show details of error in child process on exception.
* io.c (popen_exec): add error message arguments.
(pipe_open): show details of error in child process on exception.
* include/ruby/intern.h (rb_run_exec_options): add error message
arguments.
(rb_exec): ditto.
(rb_fork): ditto.
(rb_spawn): ditto.
* ext/pty/pty.c (chfunc): add error message arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-23 13:15:54 +00:00
akr
cad0fbddf8
rdoc update.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-18 14:33:31 +00:00
akr
d74d2d13cb
rdoc update.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-17 15:48:22 +00:00
akr
8ae0a40d02
* ext/pty/extconf.rb: check util.h for OpenBSD.
...
* ext/pty/pty.c: include util.h if available. fix variable name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-17 10:38:19 +00:00
akr
e27fbfbc98
* ext/pty/pty.c (getDevice): add nomesg argument.
...
(get_device_once): add nomesg argument. chmod slave tty to 0600
if nomesg. more error tests.
(no_mesg): new function.
(pty_open): make slave tty's mode 0600.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-16 11:39:17 +00:00
akr
56709edc89
* ext/pty/extconf.rb: check posix_openpt.
...
* ext/pty/pty.c (get_device_once): use posix_openpt if available.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-16 10:49:12 +00:00
akr
bfaef6a336
* ext/pty/pty.c (pty_open): set FMODE_SYNC and FMODE_DUPLEX.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-15 14:35:00 +00:00