summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Troan <ewt@src.gnome.org>1998-07-27 12:55:49 +0000
committerErik Troan <ewt@src.gnome.org>1998-07-27 12:55:49 +0000
commit269a10614e3a5aff9bfacdcd87bbf0b66179bc14 (patch)
tree3f7b462d3df15dcf8709c80e6ff621e56e3d2f0d
parente18551f99b7158c55fdef50d0f5dc67bcfcf15ca (diff)
downloadgnome-common-269a10614e3a5aff9bfacdcd87bbf0b66179bc14.tar.gz
don't use mmap anymore -- it's not worth the trouble
svn path=/trunk/; revision=291
-rw-r--r--support/popt.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/support/popt.c b/support/popt.c
index bf814eb..d572536 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;