Commit Diff
- Commit:
e39620502e6b32eee63d515326263d3566914cb0
- From:
- Omar Polo <op@omarpolo.com>
- Date:
- Message:
- fix the stat on directories For directories, f-dir->fd is *the* file descriptor associated with that directory, so doing a fstatat(f->dir->fd, f->fpath) was trying to do a lookup for f->fpath (the directory name) *inside* the directory itself. bug spotted by cage, thanks!
- Actions:
- Patch | Tree
--- client.c +++ client.c @@ -1506,6 +1506,8 @@ tstat(struct np_msg_header *hdr, const uint8_t *data, if (f->fd != -1) r = fstat(f->fd, &sb); + else if (f->qid.type & QTDIR) + r = fstat(f->dir->fd, &sb); else r = fstatat(f->dir->fd, f->fpath, &sb, 0);