Index: /trunk/psLib/src/types/psMetadataConfig.c
===================================================================
--- /trunk/psLib/src/types/psMetadataConfig.c	(revision 15410)
+++ /trunk/psLib/src/types/psMetadataConfig.c	(revision 15411)
@@ -11,6 +11,6 @@
 *  @author Joshua Hoblitt, University of Hawaii 2006-2007
 *
-*  @version $Revision: 1.140 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2007-09-22 03:05:50 $
+*  @version $Revision: 1.141 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2007-10-29 21:36:02 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -26,8 +26,12 @@
 #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"
@@ -1177,4 +1181,5 @@
     PS_ASSERT_STRING_NON_EMPTY(filename, NULL);
 
+#ifdef USE_MMAP_TO_READ_FILE
     // Attempt to open specified file
     int fd = 0;
@@ -1220,27 +1225,31 @@
         return NULL;
     }
-
-    bool success = true;
+#else
+    psString file = psSlurpFilename(filename);
+#endif
 
     md = psMetadataConfigParse(md, nFail, (char *)file, overwrite);
     if (!md) {
         psError(PS_ERR_IO, true, _("failed to parse file '%s'"), filename);
-        success = false;
-    }
-
+        psFree(md);
+        return false;
+    }
+
+#ifdef USE_MMAP_TO_READ_FILE
     if (munmap(file, nBytes) != 0) {
         psError(PS_ERR_IO, true, _("failed to munmap file '%s'"), filename);
-        success = false;
+        psFree(md);
+        return false;
     }
 
     if (close(fd) != 0) {
         psError(PS_ERR_IO, true, _("Failed to close file '%s'."), filename);
-        success = false;
-    }
-
-    if (!success) {
-        psFree (md);
-        return NULL;
-    }
+        psFree(md);
+        return false;
+    }
+#else
+    psFree(file);
+#endif
+
     return md;
 }
