diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | hash.c | 4 | ||||
-rw-r--r-- | ruby.c | 11 |
4 files changed, 21 insertions, 7 deletions
@@ -1,3 +1,12 @@ +Wed Feb 1 22:01:47 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp> + + * configure.in, hash.c (ruby_setenv): use setenv(3) and unsetenv(3) + where they are supported. modifing environ variable seems to + segfault solaris 10. [ruby-core:7276] [ruby-dev:28270] + + * ruby.c (set_arg0): if use setenv(3), environ space cannot be used + for altering argv[0]. + Tue Jan 31 11:58:51 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp> * ext/tk/lib/multi-tk.rb: add MultiTkIp#eval and bg_eval. @@ -8,7 +17,7 @@ Tue Jan 31 11:58:51 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp> Tue Jan 31 00:08:22 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp> * ext/syck/rubyext.c (syck_resolver_transfer): workaround for SEGV. - ex: YAML.load("!map:B {}"). [ruby-core:7217] + ex: ruby -ryaml -e 'YAML.load("!map:B {}")' [ruby-core:7217] Sat Jan 28 07:49:30 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp> diff --git a/configure.in b/configure.in index 696e052022..05af353b29 100644 --- a/configure.in +++ b/configure.in @@ -506,7 +506,7 @@ AC_CHECK_FUNCS(fmod killpg wait4 waitpid fork spawnv syscall chroot fsync getcwd getpriority getrlimit setrlimit\ dlopen sigprocmask sigaction _setjmp vsnprintf snprintf\ setsid telldir seekdir fchmod mktime timegm cosh sinh tanh\ - setuid setgid daemon select_large_fdset) + setuid setgid daemon select_large_fdset setenv unsetenv) AC_ARG_ENABLE(setreuid, [ --enable-setreuid use setreuid()/setregid() according to need even if obsolete.], [use_setreuid=$enableval]) @@ -196,8 +196,6 @@ rb_hash_foreach(VALUE hash, int (*func)(ANYARGS), VALUE farg) rb_ensure(hash_foreach_call, (VALUE)&arg, hash_foreach_ensure, hash); } -static VALUE hash_alloc(VALUE); - static VALUE hash_alloc(VALUE klass) { @@ -1690,7 +1688,7 @@ ruby_setenv(const char *name, const char *value) * RTL's environ global variable directly yet. */ SetEnvironmentVariable(name,value); -#elif defined __CYGWIN__ +#elif defined(HAVE_SETENV) && defined(HAVE_UNSETENV) #undef setenv #undef unsetenv if (value) @@ -987,7 +987,14 @@ VALUE rb_progname; VALUE rb_argv; VALUE rb_argv0; -#if !defined(PSTAT_SETCMD) && !defined(HAVE_SETPROCTITLE) && !defined(DOSISH) +#if defined(PSTAT_SETCMD) || defined(HAVE_SETPROCTITLE) +#elif defined(_WIN32) +#elif defined(HAVE_SETENV) && defined(HAVE_UNSETENV) +#else +#define USE_ENVSPACE_FOR_ARG0 +#endif + +#ifdef USE_ENVSPACE_FOR_ARG0 static struct { char *begin, *end; } envspace; @@ -1061,7 +1068,7 @@ set_arg0(VALUE val, ID id) break; } } -#ifndef DOSISH +#if defined(USE_ENVSPACE_FOR_ARG0) if (s + 1 == envspace.begin) { s = envspace.end; ruby_setenv("", NULL); /* duplicate environ vars */ |