From 269a10614e3a5aff9bfacdcd87bbf0b66179bc14 Mon Sep 17 00:00:00 2001 From: Erik Troan Date: Mon, 27 Jul 1998 12:55:49 +0000 Subject: don't use mmap anymore -- it's not worth the trouble svn path=/trunk/; revision=291 --- support/popt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'support/popt.c') 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 #include #include -#include #include #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; -- cgit v1.2.1