From 6ca88cb6879f69630b17cddadffec64c6afcf5fd Mon Sep 17 00:00:00 2001 From: Zdenek Styblik Date: Tue, 23 Dec 2014 14:10:34 +0100 Subject: [PATCH] ID:354 - replace/drop caddr_t in IMB Commit replaces caddr_t in IMB driver with char *. This is a wild guess replacement, because caddr_t doesn't have to be char *. However, it shouldn't be used and so shouldn't mmap(). So we'll have to see how things work out. http://computer-programming-forum.com/47-c-language/556a90938d01f023.htm --- src/plugins/imb/imbapi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/imb/imbapi.c b/src/plugins/imb/imbapi.c index 37d3abe..111df62 100644 --- a/src/plugins/imb/imbapi.c +++ b/src/plugins/imb/imbapi.c @@ -1981,7 +1981,7 @@ MapPhysicalMemory(int startAddress,int addressLength, int *virtualAddress ) unsigned int length = addressLength; off_t startpAddress = (off_t)startAddress; unsigned int diff; - caddr_t startvAddress; + char *startvAddress; if ((startAddress == 0) || (addressLength <= 0)) return ACCESN_ERROR; @@ -2000,13 +2000,13 @@ MapPhysicalMemory(int startAddress,int addressLength, int *virtualAddress ) startpAddress -= diff; length += diff; - if ( (startvAddress = mmap( (caddr_t)0, + if ( (startvAddress = mmap(0, length, PROT_READ, MAP_SHARED, fd, startpAddress - ) ) == (caddr_t)-1) + ) ) == MAP_FAILED) { char buf[128];