summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--support/popt.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/support/popt.c b/support/popt.c
index bf814ebb..d5725363 100644
--- a/support/popt.c
+++ b/support/popt.c
@@ -5,7 +5,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/mman.h>
#include <unistd.h>
#if HAVE_ALLOCA_H
@@ -467,8 +466,8 @@ int poptReadConfigFile(poptContext con, char * fn) {
fileLength = lseek(fd, 0, SEEK_END);
lseek(fd, 0, 0);
- file = mmap(NULL, fileLength, PROT_READ, MAP_PRIVATE, fd, 0);
- if (file == (void *) -1) {
+ file = alloca(fileLength + 1);
+ if ((fd = read(fd, file, fileLength)) != fileLength) {
rc = errno;
close(fd);
errno = rc;