summaryrefslogtreecommitdiff
path: root/process.c
AgeCommit message (Collapse)Author
2012-06-19fix async-signal-safe comments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-19process.c: no method calls in async-signal-safenobu
* process.c (rb_execarg_run_options): do not call any methods in the async-signal-safe function. mask has been checked with NUM2MODET() already and converted with LONG2NUM(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-14* process.c (proc_exec_sh): don't strip leading spaces of the script.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-13update doc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-13update doc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-13* process.c (rb_fork_internal): move a variable declaration.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-13process.c: suppress warningnobu
* process.c (compare_posix_sh): not used on Win32. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-13process.c: no SIZE_T_MAXnobu
* process.c (rb_exec_fillarg): get rid of SIZE_T_MAX which may need more headers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-13process.c: fix array element sizenobu
* process.c (rb_exec_fillarg): fix array element size. "continue" and "readonly" exceeded the size. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-13process.c: use shell for reserved or special built-innobu
* process.c (rb_exec_fillarg): use shell if the first word is reserved or special built-in name. http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-13process.c: treat '=' only in the first wordnobu
* process.c (rb_exec_fillarg): treat '=' only in the first word. if the first word does not contain '=', it is the command name and environment assignments cannot be anymore. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-13process.c: constifiednobu
* process.c (rb_exec_fillarg): constified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-12* process.c (rb_exec_arg_fixup): fix compile errorngoto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-12* process.c (rb_exec_fillarg): treat '=' character as an metaakr
character to detect assignments preceding command name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36041 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-11* process.c (rb_exec_fillarg): detect '#' as a meta character.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-11add comment about meta characters.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10* process.c (rb_proc_exec_n): revert the function removed at r35889.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10* process.c (rb_exec_without_timer_thread): renamed from rb_exec_err.akr
(rb_exec_err): new stub function to call rb_exec_without_timer_thread. (rb_f_exec): call rb_exec_without_timer_thread. (rb_exec): call rb_exec_without_timer_thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10* process.c (rb_fork): call rb_fork_internal instead of rb_fork_err.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10* process.c (rb_fork_ruby): call rb_fork_internal directly.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10* process.c (rb_fork_ruby): new function.akr
(rb_f_fork): use rb_fork_ruby instead of rb_fork. (rb_daemon): ditto. * io.c (pipe_open): use rb_fork_ruby instead of rb_fork. * internal.h (rb_fork_ruby): declared. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10* process.c (retry_fork): call after_fork except in a child process.akr
(rb_fork_internal): restrict after_fork call condition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10* process.c (rb_f_exec): call rb_exec_async_signal_safe except onakr
Mac OS X. cf. the comment in before_exec_non_async_signal_safe. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10* process.c (rb_fork_internal): call after_fork only unlessakr
chfunc_is_async_signal_safe. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10update async-signal-safe comments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36004 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-10* process.c (rb_f_exec): use rb_exec_arg_prepare.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-09* process.c: split after_exec into async-signal-safe part and rest.akr
(after_exec_async_signal_safe): extracted from after_exec. (after_exec_non_async_signal_safe): ditto. (after_exec): call them. (rb_exec_async_signal_safe): call after_exec_async_signal_safe. (rb_exec_err): call after_exec_non_async_signal_safe instead of after_exec. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-09* process.c (rb_fork_internal): initialize exc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-09* process.c: don't use non async-signal-safe functions in a childakr
process before exec, for invoking a command. (rb_exec_atfork): call rb_exec_async_signal_safe only. (retry_fork): take chfunc_is_async_signal_safe argument. call before_fork and after_fork only unless chfunc_is_async_signal_safe. (send_child_error): take chfunc_is_async_signal_safe argument. send an exception only unless chfunc_is_async_signal_safe. (recv_child_error): take chfunc_is_async_signal_safe argument. receive an exception only unless chfunc_is_async_signal_safe. (rb_fork_internal): renamed from rb_fork_err and take chfunc_is_async_signal_safe argument. use rb_protect only unless chfunc_is_async_signal_safe. (rb_fork_err): call rb_fork_internal with false as chfunc_is_async_signal_safe. (rb_fork_async_signal_safe): call rb_fork_internal with true as chfunc_is_async_signal_safe. (rb_spawn_process): call rb_fork_async_signal_safe instead of rb_fork_err. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-09* process.c (rb_fork_err): rewrite a complex "if" statement.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-09* process.c (before_exec_async_signal_safe): extracted fromakr
before_exec. (before_exec_non_async_signal_safe): ditto. (before_exec): call before_exec_async_signal_safe and before_exec_non_async_signal_safe. (rb_exec_async_signal_safe): call before_exec_async_signal_safe. (rb_exec_err): call before_exec_non_async_signal_safe instead of before_exec. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-09* process.c (retry_fork): rewrite a complex "for" statement byakr
simple statements. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-09* process.c (retry_fork): extracted from rb_fork_err.akr
(send_child_error): ditto. (recv_child_error): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-09update async-signal-safe comments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-09* process.c (rb_exec_async_signal_safe): extracted from rb_exec_err.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-09update async-signal-safe comments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-09* process.c: simplified because close_others option is alwaysakr
enabled by default. (rb_f_exec): don't need to set the option. (rb_exec_arg_prepare): don't need to set the option. don't need default_close_others argument. (rb_spawn_internal): don't need to give default_close_others argument for rb_exec_arg_prepare. don't need default_close_others argument. (rb_spawn_err): don't need to give default_close_others argument for rb_spawn_internal. (rb_spawn): don't need to give default_close_others argument for rb_spawn_internal. (rb_f_system): don't need to give default_close_others argument for rb_spawn_internal. (rb_f_spawn): don't need to give default_close_others argument for rb_exec_arg_prepare. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-09* process.c (rb_proc_exec): call before_exec() here addition toakr
rb_exec_err. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-08* remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-08* process.c (rb_exec_err): before_exec() call moved from proc_exec_cmdakr
and proc_exec_sh. (rb_proc_exec): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-08* include/ruby/intern.h (rb_exec_arg_init): declaration changed toakr
return a value. * process.c (rb_exec_arg_init): return a value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-08* process.c: don't check the availability of FD_CLOEXEC. It shouldakr
be available if fork() is available. * io.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-08add comments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-08* process.c (rb_fork_err): revert r35955. The condition needs !chfuncakr
to close ep[0] and ep[1]. The catched exception is re-raised immediately after that if status is not NULL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-08* process.c (rb_exec_err): after_exec() call moved from proc_exec_cmd andakr
proc_exec_sh. (rb_proc_exec): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-08* process.c (ARGV_COUNT): unused macro removed.akr
(ARGV_SIZE): ditto. (ALLOC_ARGV): ditto. (ALLOC_ARGV_WITH_STR): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-08process.c: child process error statenobu
* process.c (rb_fork_err): error state in the child process is prior to exceptions in proc_syswait(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35960 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