Use mmap retuned value.

Reviewed by: deischen
This commit is contained in:
David Xu 2003-06-28 09:48:05 +00:00
parent 8d5f23a1f9
commit d15cbd7dc0
2 changed files with 6 additions and 4 deletions

View File

@ -200,8 +200,9 @@ _thr_stack_alloc(struct pthread_attr *attr)
_kse_critical_leave(crit);
/* Map the stack, but not the guard page: */
if (mmap(attr->stackaddr_attr, stacksize,
PROT_READ | PROT_WRITE, MAP_STACK, -1, 0) == MAP_FAILED)
if ((attr->stackaddr_attr = mmap(attr->stackaddr_attr,
stacksize, PROT_READ | PROT_WRITE, MAP_STACK,
-1, 0)) == MAP_FAILED)
attr->stackaddr_attr = NULL;
}
if (attr->stackaddr_attr != NULL)

View File

@ -200,8 +200,9 @@ _thr_stack_alloc(struct pthread_attr *attr)
_kse_critical_leave(crit);
/* Map the stack, but not the guard page: */
if (mmap(attr->stackaddr_attr, stacksize,
PROT_READ | PROT_WRITE, MAP_STACK, -1, 0) == MAP_FAILED)
if ((attr->stackaddr_attr = mmap(attr->stackaddr_attr,
stacksize, PROT_READ | PROT_WRITE, MAP_STACK,
-1, 0)) == MAP_FAILED)
attr->stackaddr_attr = NULL;
}
if (attr->stackaddr_attr != NULL)