]> Zhao Yanbai Git Server - minix.git/commitdiff
mthread: mmap returns MAP_FAILED on error
authorBen Gras <ben@minix3.org>
Wed, 30 May 2012 22:46:47 +0000 (00:46 +0200)
committerBen Gras <ben@minix3.org>
Wed, 30 May 2012 22:54:11 +0000 (00:54 +0200)
lib/libmthread/allocate.c

index c82143d72fe20936fb2b8932b50f81f896b8482f..3eb1f0610d6405e71f7ce716d12fe2a1941e58c3 100644 (file)
@@ -406,7 +406,7 @@ void *arg;
        stackaddr = minix_mmap(NULL, stacksize,
                               PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE,
                               -1, 0);
-       if (stackaddr == NULL)
+       if (stackaddr == MAP_FAILED)
                mthread_panic("Failed to allocate stack to thread");
 
 #if (_MINIX_CHIP == _CHIP_INTEL)