freebsd-ports/devel/ElectricFence/files/patch-mmap-size
Mikhail Teterin 0b7c87f9e9 Add a patch found on RedHat mailing list. It is quite important,
where size_t is wider than int...

Bump PORTREVISION.
2007-07-27 13:00:52 +00:00

28 lines
660 B
Text

Found at:
http://www.redhat.com/archives/fedora-cvs-commits/2007-March/msg00788.html
Size is, correctly, size_t and mmap, correctly, takes
size_t as the size argument; the cast to int flunks
64bit thinking.
diff -Naur ElectricFence-2.2.2/page.c ElectricFence-2.2.3/page.c
--- page.c 2007-03-16 13:20:44.000000000 -0400
+++ page.c 2007-03-16 13:23:28.000000000 -0400
@@ -70,7 +70,7 @@
*/
allocation = (caddr_t) mmap(
startAddr
- ,(int)size
+ ,size
,PROT_READ|PROT_WRITE
,MAP_PRIVATE|MAP_ANONYMOUS
,-1
@@ -122,7 +122,7 @@
*/
allocation = (caddr_t) mmap(
startAddr
- ,(int)size
+ ,size
,PROT_READ|PROT_WRITE
,MAP_PRIVATE
,devZeroFd