--- IO-AIO/AIO.xs 2011/09/27 00:41:51 1.196 +++ IO-AIO/AIO.xs 2011/09/27 02:16:49 1.198 @@ -619,10 +619,12 @@ case EIO_STAT: case EIO_LSTAT: case EIO_FSTAT: - PL_laststype = req->type == EIO_LSTAT ? OP_LSTAT : OP_STAT; - PL_laststatval = req->result; - /* if compilation fails here then perl's Stat_t is not struct _stati64 */ - PL_statcache = *(EIO_STRUCT_STAT *)(req->ptr2); + PL_laststype = req->type == EIO_LSTAT ? OP_LSTAT : OP_STAT; + + if (!(PL_laststatval = req->result)) + /* if compilation fails here then perl's Stat_t is not struct _stati64 */ + PL_statcache = *(EIO_STRUCT_STAT *)(req->ptr2); + PUSHs (sv_result); break; @@ -820,7 +822,7 @@ static void req_set_path (aio_req req, SV *path, SV **wdsv, SV **pathsv, eio_wd *wd, void **ptr) { - if (SvROK (path)) + if (expect_false (SvROK (path))) { AV *av = (AV *)SvRV (path); SV *wdob; @@ -1361,13 +1363,13 @@ dREQ; req->type = EIO_READDIR; - req->sv1 = newSVsv (pathname); - req->ptr1 = SvPVbyte_nolen (req->sv1); req->int1 = flags | EIO_READDIR_DENTS | EIO_READDIR_CUSTOM1; if (flags & EIO_READDIR_DENTS) req->int1 |= EIO_READDIR_CUSTOM2; + req_set_path1 (req, pathname); + REQ_SEND; }