diff --git a/conts/posix/test0/src/mmaptest.c b/conts/posix/test0/src/mmaptest.c index 5ff6230..b6e82ec 100644 --- a/conts/posix/test0/src/mmaptest.c +++ b/conts/posix/test0/src/mmaptest.c @@ -33,7 +33,7 @@ int mmaptest(void) if (write(fd, &x, sizeof(x)) < 0) goto out_err; - if ((int)(base = mmap(0, PAGE_SIZE*16, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)) < 0) + if (IS_ERR(base = mmap(0, PAGE_SIZE*16, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0))) goto out_err; *(unsigned int *)(base + PAGE_SIZE*2) = 0x1000; diff --git a/conts/posix/test0/src/mutextest.c b/conts/posix/test0/src/mutextest.c index 60669fd..d4f4574 100644 --- a/conts/posix/test0/src/mutextest.c +++ b/conts/posix/test0/src/mutextest.c @@ -49,8 +49,8 @@ int user_mutex_test(void) * Create a shared anonymous memory region. This can be * accessed by both parent and child after a fork. */ - if ((int)(base = mmap(0, map_size, PROT_READ | PROT_WRITE, - MAP_SHARED | MAP_ANONYMOUS, 0, 0)) < 0) { + if (IS_ERR(base = mmap(0, map_size, PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_ANONYMOUS, 0, 0))) { printf("%s: mmap for extended ipc buffer failed: %x\n", __FUNCTION__, (int)base); goto out_err;