loadpolicy.c: Fix return handling for case of mmap failure

mmap() returns MAP_FAILED not NULL.

Signed-off-by: Don Slutz <dslutz@verizon.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
Don Slutz authored and Ian Campbell committed 2014-07-30 12:42:17 +01:00
1 parent a1ac4cf52e
commit 822b956ef7
1 file changed
+1 -1
+1 -1
View File
@@ -61,7 +61,7 @@ int main (int argCnt, const char *args[])
#ifdef USE_MMAP
polMem = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, polFd, 0);
if ( !polMem )
if ( polMem == MAP_FAILED )
{
fprintf(stderr, "Error occurred mapping policy file in memory: %s\n",
strerror(errno));
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.