diff options
author | ewt <devnull@localhost> | 1998-07-27 12:55:49 +0000 |
---|---|---|
committer | ewt <devnull@localhost> | 1998-07-27 12:55:49 +0000 |
commit | 3bcb7e50e52426cf3dbfddb40aed60e53be9de2e (patch) | |
tree | 276b3a5f2f20ce452557843c26d0666f87657599 /popt/popt.c | |
parent | e4151252f8c4e422e18f83616392e3dc53d6d1ab (diff) | |
download | rpm-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.c | 5 |
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; |