Properly pass S_IFLINK back
authorRonald G. Minnich <rminnich@google.com>
Fri, 31 Jan 2014 16:25:27 +0000 (08:25 -0800)
committerRonald G. Minnich <rminnich@google.com>
Fri, 31 Jan 2014 16:25:27 +0000 (08:25 -0800)
If DMSYMLINK is set, convert it to S_IFLINK.
We now see proper stat for files served by (e.g.) ufs.

Signed-off-by: Ronald G. Minnich <rminnich@google.com>
kern/src/ns/convM2kdirent.c

index 14fd968..b878925 100644 (file)
@@ -124,6 +124,9 @@ unsigned int convM2kstat(uint8_t * buf, unsigned int nbuf, struct kstat *ks)
        if (ks->st_mode & DMDIR) {
                ks->st_mode &= ~DMDIR;
                ks->st_mode |= __S_IFDIR;
+       } else if (ks->st_mode & DMSYMLINK) {
+               ks->st_mode &= ~DMSYMLINK;
+               ks->st_mode |= __S_IFLNK;
        } else {
                ks->st_mode |= __S_IFREG;
        }