--- libaitio/src/aio.c 2012/08/02 00:47:47 1.6 +++ libaitio/src/aio.c 2013/03/13 14:54:39 1.7 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aio.c,v 1.6 2012/08/02 00:47:47 misho Exp $ +* $Id: aio.c,v 1.7 2013/03/13 14:54:39 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -12,7 +12,7 @@ terms: All of the documentation and software included in the ELWIX and AITNET Releases is copyrighted by ELWIX - Sofia/Bulgaria -Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -271,20 +271,20 @@ io_rreadv(int fd, struct iovec * __restrict bufs, int if (!update) lseek(fd, old, SEEK_SET); - acb = io_calloc(sizeof(void*), nbufs); + acb = e_calloc(sizeof(void*), nbufs); if (!acb) { LOGERR; return -1; } memset(acb, 0, sizeof(void*) * nbufs); for (i = 0, off = offset; i < nbufs; off += bufs[i++].iov_len) { - acb[i] = io_malloc(sizeof(struct aiocb)); + acb[i] = e_malloc(sizeof(struct aiocb)); if (!acb[i]) { LOGERR; for (i = 0; i < nbufs; i++) if (acb[i]) - io_free(acb[i]); - io_free(acb); + e_free(acb[i]); + e_free(acb); return -1; } else memset(acb[i], 0, sizeof(struct aiocb)); @@ -300,8 +300,8 @@ io_rreadv(int fd, struct iovec * __restrict bufs, int LOGERR; for (i = 0; i < nbufs; i++) if (acb[i]) - io_free(acb[i]); - io_free(acb); + e_free(acb[i]); + e_free(acb); return -1; } @@ -309,9 +309,9 @@ io_rreadv(int fd, struct iovec * __restrict bufs, int bufs[i].iov_len = aio_return(acb[i]); offset += bufs[i].iov_len; if (acb[i]) - io_free(acb[i]); + e_free(acb[i]); } - io_free(acb); + e_free(acb); #else ret = preadv(fd, bufs, nbufs, offset); if (ret == -1) { @@ -362,20 +362,20 @@ io_rwritev(int fd, struct iovec * __restrict bufs, int } #ifdef AIO_OPS - acb = io_calloc(sizeof(void*), nbufs); + acb = e_calloc(sizeof(void*), nbufs); if (!acb) { LOGERR; return -1; } else memset(acb, 0, sizeof(void*) * nbufs); for (i = 0, off = offset; i < nbufs; off += bufs[i++].iov_len) { - acb[i] = io_malloc(sizeof(struct aiocb)); + acb[i] = e_malloc(sizeof(struct aiocb)); if (!acb[i]) { LOGERR; for (i = 0; i < nbufs; i++) if (acb[i]) - io_free(acb[i]); - io_free(acb); + e_free(acb[i]); + e_free(acb); return -1; } else memset(acb[i], 0, sizeof(struct aiocb)); @@ -391,8 +391,8 @@ io_rwritev(int fd, struct iovec * __restrict bufs, int LOGERR; for (i = 0; i < nbufs; i++) if (acb[i]) - io_free(acb[i]); - io_free(acb); + e_free(acb[i]); + e_free(acb); return -1; } @@ -400,9 +400,9 @@ io_rwritev(int fd, struct iovec * __restrict bufs, int bufs[i].iov_len = aio_return(acb[i]); offset += bufs[i].iov_len; if (acb[i]) - io_free(acb[i]); + e_free(acb[i]); } - io_free(acb); + e_free(acb); #else ret = pwritev(fd, bufs, nbufs, offset); if (ret == -1) {