--- libeio/eio.c 2018/06/15 02:57:36 1.150 +++ libeio/eio.c 2018/08/17 17:17:07 1.153 @@ -1397,26 +1397,26 @@ } #else #if HAVE_AT - if (req->wd) - { - int fd = openat (WD2FD (req->wd), req->ptr1, O_CLOEXEC | O_SEARCH | O_DIRECTORY); + { + int fd = openat (WD2FD (req->wd), req->ptr1, O_CLOEXEC | O_SEARCH | O_DIRECTORY); - if (fd < 0) - return; + if (fd < 0) + return; - dirp = fdopendir (fd); + dirp = fdopendir (fd); - if (!dirp) + if (!dirp) + { silent_close (fd); - } - else - dirp = opendir (req->ptr1); + return; + } + } #else dirp = opendir (wd_expand (&self->tmpbuf, req->wd, req->ptr1)); - #endif - if (!dirp) - return; + if (!dirp) + return; + #endif #endif if (req->flags & EIO_FLAG_PTR1_FREE) @@ -1683,7 +1683,7 @@ eio_wd eio_wd_open_sync (eio_wd wd, const char *path) { - struct etp_tmpbuf tmpbuf = { }; + struct etp_tmpbuf tmpbuf = { 0 }; wd = eio__wd_open_sync (&tmpbuf, wd, path); free (tmpbuf.ptr);