diff --git a/ChangeLog b/ChangeLog index 6a4951967a..2d7f35b981 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,7 @@ -Thu Mar 12 05:09:56 2009 Nobuyoshi Nakada +Thu Mar 12 05:12:53 2009 Nobuyoshi Nakada + + * thread_pthread.c (ruby_init_stack): range of rlim_cur may be + larger than int. * missing/vsnprintf.c (BSD_vfprintf): commented out code which has no effect at all. diff --git a/thread_pthread.c b/thread_pthread.c index 91c5b42d67..11a70d77a3 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -292,10 +292,10 @@ ruby_init_stack(VALUE *addr struct rlimit rlim; if (getrlimit(RLIMIT_STACK, &rlim) == 0) { - unsigned int space = rlim.rlim_cur/5; + size_t space = (size_t)(rlim.rlim_cur/5); if (space > 1024*1024) space = 1024*1024; - native_main_thread.stack_maxsize = rlim.rlim_cur - space; + native_main_thread.stack_maxsize = (size_t)rlim.rlim_cur - space; } } #endif