don't use mmap anymore -- it's not worth the trouble

CVS patchset: 2184
CVS date: 1998/07/27 12:55:49
This commit is contained in:
ewt 1998-07-27 12:55:49 +00:00
parent e4151252f8
commit 3bcb7e50e5
1 changed files with 2 additions and 3 deletions

View File

@ -5,7 +5,6 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/mman.h>
#include <unistd.h> #include <unistd.h>
#if HAVE_ALLOCA_H #if HAVE_ALLOCA_H
@ -467,8 +466,8 @@ int poptReadConfigFile(poptContext con, char * fn) {
fileLength = lseek(fd, 0, SEEK_END); fileLength = lseek(fd, 0, SEEK_END);
lseek(fd, 0, 0); lseek(fd, 0, 0);
file = mmap(NULL, fileLength, PROT_READ, MAP_PRIVATE, fd, 0); file = alloca(fileLength + 1);
if (file == (void *) -1) { if ((fd = read(fd, file, fileLength)) != fileLength) {
rc = errno; rc = errno;
close(fd); close(fd);
errno = rc; errno = rc;