Permalink
Browse files

Fix #1138

  • Loading branch information...
1 parent 49129eb commit 81dc5fcf2e9fa50d5382efdfd37a156649fe6c94 @web-flow web-flow committed with timholy Aug 8, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 base/mmap.jl
View
@@ -11,7 +11,7 @@ function mmap(len::Integer, prot::Integer, flags::Integer, fd::Integer, offset::
len_page::Int = (offset-offset_page) + len
# Mmap the file
p = ccall(:mmap, Ptr{Void}, (Ptr{Void}, Int, Int32, Int32, Int32, FileOffset), C_NULL, len_page, prot, flags, fd, offset_page)
- if convert(Int,p) < 1
+ if convert(Int,p) == -1
error("Memory mapping failed", strerror())
end
# Also return a pointer that compensates for any adjustment in the offset

0 comments on commit 81dc5fc

Please sign in to comment.