summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--cont.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 976cc42..599144e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Wed Jul 6 21:22:16 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * cont.c (fiber_machine_stack_alloc): use MAP_FAILED instead of -1.
+
Wed Jul 6 21:21:05 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* cont.c (fiber_machine_stack_alloc): remove unnecessary cast.
diff --git a/cont.c b/cont.c
index e260a40..db4d93b 100644
--- a/cont.c
+++ b/cont.c
@@ -537,7 +537,7 @@ fiber_machine_stack_alloc(size_t size)
void *page;
STACK_GROW_DIR_DETECTION;
ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
- if (ptr == (VALUE*)(SIGNED_VALUE)-1) {
+ if (ptr == MAP_FAILED) {
rb_raise(rb_eFiberError, "can't alloc machine stack to fiber");
}
page = ptr + STACK_DIR_UPPER((size - RB_PAGE_SIZE) / sizeof(VALUE), 0);