X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=util%2Fnmem.c;h=75cbd20496d013301a211030acdeb175f961e4b8;hb=929d26653d54a64c12dff06cbb470c22667d79f1;hp=375957c43ffc7616e449b91c757570b59a254789;hpb=b340923765c14d2ba050a171bb557474044d7e6a;p=yaz-moved-to-github.git diff --git a/util/nmem.c b/util/nmem.c index 375957c..75cbd20 100644 --- a/util/nmem.c +++ b/util/nmem.c @@ -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 #include +#include #include #include #include @@ -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; +}