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:
parent
e4151252f8
commit
3bcb7e50e5
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue