--- libaitio/src/aitio.c 2012/05/23 14:37:36 1.10.6.6 +++ libaitio/src/aitio.c 2012/11/15 23:18:33 1.12.6.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitio.c,v 1.10.6.6 2012/05/23 14:37:36 misho Exp $ +* $Id: aitio.c,v 1.12.6.1 2012/11/15 23:18:33 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -105,15 +105,15 @@ io_mm_inuse() // init libaitio routine -void -_init() +__attribute__((constructor)) void +_io_init() { ioLibInit(IO_MPOOL, 0); } // fini libaitio routine -void -_fini() +__attribute__((destructor)) void +_io_fini() { ioLibFini(); } @@ -168,14 +168,14 @@ ioLibFini() { switch (use_mm) { case IO_MPOOL: - mpool_destroy(&io_mpool); - io_malloc = malloc; io_calloc = calloc; io_realloc = realloc; io_strdup = strdup; io_free = free; use_mm = IO_SYSM; + + mpool_destroy(&io_mpool); break; } } @@ -474,7 +474,7 @@ ioStrAst(const char *csString) io_Errno = EINVAL; return NULL; } else { - str = strdup(strchr(csString, '{') + 1); + str = io_strdup(strchr(csString, '{') + 1); *strrchr(str, '}') = 0; } @@ -496,7 +496,7 @@ ioStrAst(const char *csString) /* ok, clear show */ ext = str; - out = strdup(ext); + out = io_strdup(ext); io_free(str); return out; @@ -519,7 +519,7 @@ ioMkDir(const char *csDir, int mode) if (!csDir) return cx; - str = strdup(csDir); + str = io_strdup(csDir); if (!str) { LOGERR; return cx;