--- libeio/eio.c 2011/06/10 12:45:20 1.72 +++ libeio/eio.c 2011/06/29 10:32:55 1.75 @@ -202,7 +202,7 @@ #define ETP_NUM_PRI (ETP_PRI_MAX - ETP_PRI_MIN + 1) /* calculate time difference in ~1/EIO_TICKS of a second */ -ECB_INLINE int +ecb_inline int tvdiff (struct timeval *tv1, struct timeval *tv2) { return (tv2->tv_sec - tv1->tv_sec ) * EIO_TICKS @@ -1008,7 +1008,7 @@ if (sbytes) res = sbytes; -# elif defined (__APPLE__) +# elif defined (__APPLE__) && 0 /* broken, as everything on os x */ off_t sbytes = count; res = sendfile (ifd, ofd, offset, &sbytes, 0, 0); @@ -1308,6 +1308,9 @@ /* the corresponding closedir is in ETP_WORKER_CLEAR */ self->dirp = dirp = opendir (req->ptr1); + if (req->flags & EIO_FLAG_PTR1_FREE) + free (req->ptr1); + req->flags |= EIO_FLAG_PTR1_FREE | EIO_FLAG_PTR2_FREE; req->ptr1 = dents = flags ? malloc (dentalloc * sizeof (eio_dirent)) : 0; req->ptr2 = names = malloc (namesalloc); @@ -1697,7 +1700,7 @@ return etp_init (want_poll, done_poll); } -ECB_INLINE void +ecb_inline void eio_api_destroy (eio_req *req) { free (req);