Index: /trunk/psLib/src/types/psMetadataConfig.c
===================================================================
--- /trunk/psLib/src/types/psMetadataConfig.c	(revision 15504)
+++ /trunk/psLib/src/types/psMetadataConfig.c	(revision 15505)
@@ -11,6 +11,6 @@
 *  @author Joshua Hoblitt, University of Hawaii 2006-2007
 *
-*  @version $Revision: 1.141 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2007-10-29 21:36:02 $
+*  @version $Revision: 1.142 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2007-11-08 04:24:01 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -26,12 +26,5 @@
 #include <limits.h>
 #include <strings.h>
-#ifdef USE_MMAP_TO_READ_FILE
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#else
 #include "psSlurp.h"
-#endif
 
 #include "psMemory.h"
@@ -1181,51 +1174,5 @@
     PS_ASSERT_STRING_NON_EMPTY(filename, NULL);
 
-#ifdef USE_MMAP_TO_READ_FILE
-    // Attempt to open specified file
-    int fd = 0;
-    fd = open(filename, O_RDONLY);
-    if (fd < 0) {
-        // XXX really should return strerror() here
-        psError(PS_ERR_IO, true,
-                _("Failed to open file '%s'. Check if it exists and it has the proper "
-                  "permissions."), filename);
-        close(fd);
-        return NULL;
-    }
-
-    // Results of stat() for file
-    struct stat buf;
-    if (fstat(fd, &buf) != 0) {
-        psError(PS_ERR_IO, true, _("Unable to stat file '%s'.\n"), filename);
-        close(fd);
-        return NULL;
-    }
-    // XXX EAM : for some reason, the mmap below results in a buffer which causes
-    // bus errors if the file is empty.  This seems like a strange result...
-    if (buf.st_size == 0) {
-        // We successfully read everything we could.  Return a MD containing what we read.
-        close(fd);
-        return psMetadataAlloc();
-    }
-
-    // psMetadataConfigParse() is going to read the entire file into memory so
-    // lets use mmap() to allow the system to be cleverer about what gets read
-    //
-    // We're adding 1 to buf.st_size here in case st_size / system page size has
-    // a remainder of zero (otherwise there won't be any trailing \0s at the end
-    // of the page).
-    int nBytes = buf.st_size + 1;
-
-    void *file = mmap(0, nBytes, PROT_READ, MAP_PRIVATE, fd, 0);
-    if (file == MAP_FAILED) {
-        psError(PS_ERR_IO, true, _("failed to mmap() file %s"), filename);
-        if (close(fd) != 0) {
-            psError(PS_ERR_IO, true, _("Failed to close file '%s'."), filename);
-        }
-        return NULL;
-    }
-#else
     psString file = psSlurpFilename(filename);
-#endif
 
     md = psMetadataConfigParse(md, nFail, (char *)file, overwrite);
@@ -1236,19 +1183,5 @@
     }
 
-#ifdef USE_MMAP_TO_READ_FILE
-    if (munmap(file, nBytes) != 0) {
-        psError(PS_ERR_IO, true, _("failed to munmap file '%s'"), filename);
-        psFree(md);
-        return false;
-    }
-
-    if (close(fd) != 0) {
-        psError(PS_ERR_IO, true, _("Failed to close file '%s'."), filename);
-        psFree(md);
-        return false;
-    }
-#else
     psFree(file);
-#endif
 
     return md;
