aboutsummaryrefslogtreecommitdiffstats
path: root/process.c
Commit message (Collapse)AuthorAgeFilesLines
...
* * process.c (check_exec_redirect1): extracted fromakr2012-06-231-17/+24
| | | | | | | | check_exec_redirect. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (save_env): don't use EXEC_OPTION_UNSETENV_OTHERS.akr2012-06-231-3/+3
| | | | | | | | (rb_execarg_run_options): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h (rb_execarg): add env_modification field.akr2012-06-231-8/+8
| | | | | | | | | | | | | * process.c (EXEC_OPTION_ENV): removed. (mark_exec_arg): mark env_modification field. (rb_exec_fillarg): update the new field, instead of options array. (rb_execarg_fixup): use the new field. (save_env): ditto. (rb_execarg_run_options): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h (rb_execarg): add rlimit_limits field.akr2012-06-231-15/+13
| | | | | | | | | | | | | * process.c (EXEC_OPTION_RLIMIT): removed. (mark_exec_arg): mark rlimit_limits field. (rb_execarg_addopt): update the new fields, instead of options array. (run_exec_rlimit): use the new field. (rb_execarg_run_options): clear sarg using MEMZERO. use the new field. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h (rb_execarg): add chdir_given and chdir_dir fields.akr2012-06-231-9/+8
| | | | | | | | | | | * process.c (EXEC_OPTION_CHDIR): removed. (mark_exec_arg): mark chdir_dir field. (rb_execarg_addopt): update the new fields, instead of options array. (rb_execarg_run_options): use the new fields. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h (rb_execarg): add close_others_given, close_others_do andakr2012-06-231-12/+9
| | | | | | | | | | | | | | | close_others_maxhint fields. * process.c (EXEC_OPTION_CLOSE_OTHERS): removed. (rb_execarg_addopt): update the new fields, instead of options array. (check_exec_fds): take eargp as an argument. update the close_others_maxhint field. (rb_execarg_fixup): follow the argument change of check_exec_fds. (rb_execarg_run_options): use the new fields. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h (rb_execarg): add unsetenv_others_given andakr2012-06-231-8/+8
| | | | | | | | | | | | unsetenv_others_do fields. * process.c (EXEC_OPTION_UNSETENV_OTHERS): removed. (rb_execarg_addopt): update the new fields, instead of options array. (rb_execarg_fixup): use the new fields. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c: use the variable name "soptions" for sargp->options.akr2012-06-231-13/+13
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c: use the name "sargp" for struct rb_execarg variablesakr2012-06-231-42/+42
| | | | | | | | | | consistently for saving process attributes. * io.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c: use the name "eargp" for struct rb_execarg variablesakr2012-06-221-101/+101
| | | | | | | | | | | | 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
* * internal.h (rb_execarg): add pgroup_given and pgroup_pgid fields.akr2012-06-221-15/+19
| | | | | | | | | | | | * process.c (EXEC_OPTION_PGROUP): removed. (rb_execarg_addopt): update the new fields, instead of options array. (run_exec_pgroup): take a struct rb_execarg argument. refer the new fields. (rb_execarg_run_options): follow run_exec_pgroup change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c: pass struct rb_execarg value instead of its optionsakr2012-06-221-27/+33
| | | | | | | | | | | | | | | | | field for saving process attribute changing functions. (save_redirect_fd): take a struct rb_execarg argument. (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. (save_env): ditto. (rb_execarg_run_options): follow the above functions change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c: constant expressionnobu2012-06-221-4/+2
| | | | | | | * process.c (rb_exec_async_signal_safe): use a constant expression instead of a macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_execarg_addopt): take a VALUE argument instead ofakr2012-06-211-7/+6
| | | | | | | | | | | | | | struct rb_execarg. (rb_exec_arg_addopt): follow the rb_execarg_addopt change. (check_exec_options_i): ditto. * io.c (pipe_open): follow the rb_execarg_addopt change. * internal.h (rb_execarg_addopt): follow the definition change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_exec_fillarg): take a VALUE argument instead ofakr2012-06-211-5/+9
| | | | | | | | | | struct rb_execarg. (rb_check_exec_options): ditto. (check_exec_options_i): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_exec_async_signal_safe): use rb_execarg_run_optionsakr2012-06-211-3/+3
| | | | | | | | | instead of rb_run_exec_options_err. (rb_spawn_process): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_exec_fillarg): take a VALUE argument instead ofakr2012-06-211-2/+4
| | | | | | | | | struct rb_execarg. (rb_execarg_init): follow the rb_exec_fillarg change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_execarg_init): take a VALUE argument instead ofakr2012-06-211-5/+8
| | | | | | | | | | | | struct rb_execarg. (rb_execarg_new): follow the rb_execarg_init change. (rb_exec_arg_init): ditto. * internal.h (rb_execarg_init): follow the definition change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c: fix typenobu2012-06-211-1/+1
| | | | | | * process.c (rb_spawn_internal): fix type of a local variable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_execarg_fixup): take a VALUE argument instead ofakr2012-06-201-12/+7
| | | | | | | | | | | | | | 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
* * internal.h (struct rb_execarg): add umask_given and umask_maskakr2012-06-201-11/+9
| | | | | | | | | | | | fields. * process.c (STATIC_ASSERT): removed. (rb_execarg_addopt): follow the rb_execarg change. (rb_execarg_run_options): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h (struct rb_execarg) moved and renamed fromakr2012-06-201-33/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* * internal.h (rb_execarg_new): declared.akr2012-06-201-12/+85
| | | | | | | | | | | | | | | | | | | | | | | (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
* process.c: fixnum umasknobu2012-06-201-1/+1
| | | | | | | | * process.c (rb_execarg_addopt): always make Fixnum, and ignore higher bits in too large umask value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix async-signal-safe comments.akr2012-06-191-6/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c: no method calls in async-signal-safenobu2012-06-191-1/+4
| | | | | | | | | * 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
* * process.c (proc_exec_sh): don't strip leading spaces of the script.akr2012-06-141-3/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update doc.akr2012-06-131-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update doc.akr2012-06-131-0/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_fork_internal): move a variable declaration.akr2012-06-131-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c: suppress warningnobu2012-06-131-0/+2
| | | | | | * 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
* process.c: no SIZE_T_MAXnobu2012-06-131-1/+1
| | | | | | | | * 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
* process.c: fix array element sizenobu2012-06-131-1/+1
| | | | | | | | * 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
* process.c: use shell for reserved or special built-innobu2012-06-131-10/+70
| | | | | | | | | * 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
* process.c: treat '=' only in the first wordnobu2012-06-131-1/+6
| | | | | | | | | * 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
* process.c: constifiednobu2012-06-131-4/+4
| | | | | | | * process.c (rb_exec_fillarg): constified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_exec_arg_fixup): fix compile errorngoto2012-06-121-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_exec_fillarg): treat '=' character as an metaakr2012-06-121-1/+1
| | | | | | | | character to detect assignments preceding command name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h (rb_exec_arg_init): deprecated.akr2012-06-121-9/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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
* * process.c (rb_exec_fillarg): detect '#' as a meta character.akr2012-06-111-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add comment about meta characters.akr2012-06-111-0/+24
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_proc_exec_n): revert the function removed at r35889.akr2012-06-101-0/+48
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_exec_without_timer_thread): renamed from rb_exec_err.akr2012-06-101-5/+13
| | | | | | | | | | | (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
* * process.c (rb_fork): call rb_fork_internal instead of rb_fork_err.akr2012-06-101-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_fork_ruby): call rb_fork_internal directly.akr2012-06-101-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_fork_ruby): new function.akr2012-06-101-3/+9
| | | | | | | | | | | | | (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
* * process.c (retry_fork): call after_fork except in a child process.akr2012-06-101-8/+9
| | | | | | | (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
* * process.c (rb_f_exec): call rb_exec_async_signal_safe except onakr2012-06-101-1/+5
| | | | | | | 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
* * process.c (rb_fork_internal): call after_fork only unlessakr2012-06-101-1/+2
| | | | | | | | chfunc_is_async_signal_safe. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update async-signal-safe comments.akr2012-06-101-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e