check mmap return against -1

This commit is contained in:
MovingtoMars 2016-01-28 13:45:35 +13:00
parent 04b721d535
commit 9c502030a1

View File

@ -12,6 +12,7 @@ pub fn malloc(bytes: isize) -> ?&u8 {
const failed: bool = switch (-result) {
0 => true,
-1 => true,
EINVAL => true,
EACCES => true,
EAGAIN => true,