ignore more files
[yaz-moved-to-github.git] / util / nmem.c
index 375957c..75cbd20 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * Copyright (c) 1995-2001, Index Data.
+ * Copyright (c) 1995-2002, Index Data.
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
- * $Id: nmem.c,v 1.34 2001-11-18 21:05:13 adam Exp $
+ * $Id: nmem.c,v 1.37 2002-09-25 12:37:07 adam Exp $
  */
 
 /*
@@ -16,6 +16,7 @@
 
 #include <assert.h>
 #include <string.h>
+#include <errno.h>
 #include <yaz/xmalloc.h>
 #include <yaz/nmem.h>
 #include <yaz/log.h>
@@ -231,8 +232,8 @@ void *nmem_malloc(NMEM n, int size)
 #endif
     if (!n)
     {
+        yaz_log (LOG_FATAL, "calling nmem_malloc with an null pointer");
         abort ();
-       return xmalloc(size);
     }
 #ifdef WIN32
     assert (nmem_init_flag);
@@ -429,3 +430,13 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL,
     return TRUE;
 }
 #endif
+
+int yaz_errno(void)
+{
+    return errno;
+}
+
+void yaz_set_errno(int v)
+{
+    errno = v;
+}