summaryrefslogtreecommitdiff
path: root/popt/popt.c
diff options
context:
space:
mode:
authorewt <devnull@localhost>1998-07-27 12:55:49 +0000
committerewt <devnull@localhost>1998-07-27 12:55:49 +0000
commit3bcb7e50e52426cf3dbfddb40aed60e53be9de2e (patch)
tree276b3a5f2f20ce452557843c26d0666f87657599 /popt/popt.c
parente4151252f8c4e422e18f83616392e3dc53d6d1ab (diff)
downloadrpm-3bcb7e50e52426cf3dbfddb40aed60e53be9de2e.tar.gz
rpm-3bcb7e50e52426cf3dbfddb40aed60e53be9de2e.tar.bz2
rpm-3bcb7e50e52426cf3dbfddb40aed60e53be9de2e.zip
don't use mmap anymore -- it's not worth the trouble
CVS patchset: 2184 CVS date: 1998/07/27 12:55:49
Diffstat (limited to 'popt/popt.c')
-rw-r--r--popt/popt.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/popt/popt.c b/popt/popt.c
index bf814ebb6..d57253635 100644
--- a/popt/popt.c
+++ b/popt/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;