diff --git a/configure.ac b/configure.ac index 31315bc17..a7b20dfdf 100644 --- a/configure.ac +++ b/configure.ac @@ -811,6 +811,10 @@ AC_TYPE_SIZE_T dnl Checks for library functions. AC_FUNC_ALLOCA AC_FUNC_VPRINTF +dnl XXX don't want to re-enable code that's been unused for years at this +dnl point, but should offer good performance improvements, check after +dnl 4.4.2.1... +dnl AC_FUNC_MMAP AC_CHECK_FUNCS(basename getcwd getwd inet_aton mtrace putenv realpath setenv) AC_CHECK_FUNCS(stpcpy stpncpy strcspn) diff --git a/lib/fsm.c b/lib/fsm.c index 40b71d7b1..435bf716a 100644 --- a/lib/fsm.c +++ b/lib/fsm.c @@ -944,7 +944,7 @@ static int writeFile(/*@special@*/ /*@partial@*/ FSM_t fsm, int writeData) if (rc) goto exit; if (writeData && S_ISREG(st->st_mode)) { -#if HAVE_MMAP +#ifdef HAVE_MMAP char * rdbuf = NULL; void * mapped = (void *)-1; size_t nmapped; @@ -954,7 +954,7 @@ static int writeFile(/*@special@*/ /*@partial@*/ FSM_t fsm, int writeData) if (rc) goto exit; /* XXX unbuffered mmap generates *lots* of fdio debugging */ -#if HAVE_MMAP +#ifdef HAVE_MMAP nmapped = 0; mapped = mmap(NULL, st->st_size, PROT_READ, MAP_SHARED, Fileno(fsm->rfd), 0); if (mapped != (void *)-1) { @@ -970,7 +970,7 @@ static int writeFile(/*@special@*/ /*@partial@*/ FSM_t fsm, int writeData) left = st->st_size; while (left) { -#if HAVE_MMAP +#ifdef HAVE_MMAP if (mapped != (void *)-1) { fsm->rdnb = nmapped; } else @@ -988,7 +988,7 @@ static int writeFile(/*@special@*/ /*@partial@*/ FSM_t fsm, int writeData) left -= fsm->wrnb; } -#if HAVE_MMAP +#ifdef HAVE_MMAP /*@-branchstate@*/ if (mapped != (void *)-1) { xx = msync(mapped, nmapped, MS_ASYNC); diff --git a/rpmdb/legacy.c b/rpmdb/legacy.c index 5fa0431ad..b97d67b70 100644 --- a/rpmdb/legacy.c +++ b/rpmdb/legacy.c @@ -170,7 +170,7 @@ int domd5(const char * fn, unsigned char * digest, int asAscii, size_t *fsizep) switch(ut) { case URL_IS_PATH: case URL_IS_UNKNOWN: -#if HAVE_MMAP +#ifdef HAVE_MMAP if (pid == 0) { DIGEST_CTX ctx; void * mapped;