int
vfs_get_dtype(int itype)
{
- if ((itype & VFS_IFSYMLINK)) {
+ if ((itype & VFS_IFSYMLINK) == VFS_IFSYMLINK) {
return DT_SYMLINK;
} else if (!(itype & VFS_IFFILE)) {
return DT_DIR;
goto done;
}
+ if (!(errno = vfs_walk(parent, name_value, &dir, NULL, 0))) {
+ errno = EEXIST;
+ goto done;
+ }
+
if ((errno = vfs_check_writable(parent))) {
goto done;
}