static int32_t wstat(Chan* c, uint8_t* p, usize n) { Proc *up = externup(); int32_t l; usize namelen; if(waserror()){ cclose(c); nexterror(); } /* * Renaming mount points is disallowed to avoid surprises * (which should be renamed? the mount point or the mounted Chan?). */ if(c->ismtpt){ dirname(p, &namelen); if(namelen) nameerror(chanpath(c), Eismtpt); } l = c->dev->wstat(c, p, n); poperror(); cclose(c); return l; }
static long wstat(Chan *c, uchar *d, int nd) { long l; int namelen; if(waserror()){ cclose(c); nexterror(); } if(c->ismtpt){ /* * Renaming mount points is disallowed to avoid surprises * (which should be renamed? the mount point or the mounted Chan?). */ dirname(d, &namelen); if(namelen) nameerror(chanpath(c), Eismtpt); } l = devtab[c->type]->wstat(c, d, nd); poperror(); cclose(c); return l; }