Emulate ENOTDIR better

This commit is contained in:
Justine Tunney 2023-08-16 20:11:19 -07:00
parent b76b2be2d0
commit 8d1c81ac9f
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
35 changed files with 80 additions and 50 deletions

View file

@ -23,14 +23,14 @@
/**
* Reads file metadata from αcτµαlly pδrταblε εxεcµταblε object store.
*
* @param uri is obtained via __zipos_parseuri()
* @param name is obtained via __zipos_parseuri()
* @asyncsignalsafe
*/
int __zipos_stat(struct ZiposUri *name, struct stat *st) {
ssize_t cf;
struct Zipos *zipos;
if (!(zipos = __zipos_get())) return enoexec();
if ((cf = __zipos_find(zipos, name)) == -1) return enoent();
if ((cf = __zipos_find(zipos, name)) == -1) return -1;
if (__zipos_stat_impl(zipos, cf, st)) return -1;
st->st_ino = __zipos_inode(zipos, cf, name->path, name->len);
return 0;