mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* thread_pthread.c (rb_thread_create_timer_thread): Show error
message instead of error number. * cont.c (fiber_machine_stack_alloc): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a66a9fbb10
commit
fbdd08b8c2
3 changed files with 10 additions and 3 deletions
|
@ -1,3 +1,10 @@
|
|||
Sun Nov 17 01:43:33 2013 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* thread_pthread.c (rb_thread_create_timer_thread): Show error
|
||||
message instead of error number.
|
||||
|
||||
* cont.c (fiber_machine_stack_alloc): Ditto.
|
||||
|
||||
Sat Nov 16 18:28:08 2013 Kouhei Sutou <kou@cozmixng.org>
|
||||
|
||||
* lib/rexml/parsers/ultralightparser.rb
|
||||
|
|
2
cont.c
2
cont.c
|
@ -625,7 +625,7 @@ fiber_machine_stack_alloc(size_t size)
|
|||
errno = 0;
|
||||
ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, FIBER_STACK_FLAGS, -1, 0);
|
||||
if (ptr == MAP_FAILED) {
|
||||
rb_raise(rb_eFiberError, "can't alloc machine stack to fiber errno: %d", errno);
|
||||
rb_raise(rb_eFiberError, "can't alloc machine stack to fiber: %s", strerror(errno));
|
||||
}
|
||||
|
||||
/* guard page setup */
|
||||
|
|
|
@ -1470,7 +1470,7 @@ rb_thread_create_timer_thread(void)
|
|||
|
||||
err = pthread_attr_init(&attr);
|
||||
if (err != 0) {
|
||||
fprintf(stderr, "[FATAL] Failed to initialize pthread attr(errno: %d)\n", err);
|
||||
fprintf(stderr, "[FATAL] Failed to initialize pthread attr: %s\n", strerror(err));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
# ifdef PTHREAD_STACK_MIN
|
||||
|
@ -1503,7 +1503,7 @@ rb_thread_create_timer_thread(void)
|
|||
err = pthread_create(&timer_thread_id, NULL, thread_timer, &GET_VM()->gvl);
|
||||
#endif
|
||||
if (err != 0) {
|
||||
fprintf(stderr, "[FATAL] Failed to create timer thread (errno: %d)\n", err);
|
||||
fprintf(stderr, "[FATAL] Failed to create timer thread: %s\n", strerror(err));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#ifdef HAVE_PTHREAD_ATTR_INIT
|
||||
|
|
Loading…
Reference in a new issue