aboutsummaryrefslogtreecommitdiff
path: root/stand/libsa/ufs.c
diff options
context:
space:
mode:
Diffstat (limited to 'stand/libsa/ufs.c')
-rw-r--r--stand/libsa/ufs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/stand/libsa/ufs.c b/stand/libsa/ufs.c
index e1d540ed2321..868e8d47dbbd 100644
--- a/stand/libsa/ufs.c
+++ b/stand/libsa/ufs.c
@@ -93,6 +93,7 @@ static int ufs_unmount(const char *dev, void *data);
struct fs_ops ufs_fsops = {
.fs_name = "ufs",
+ .fs_flags = 0,
.fo_open = ufs_open,
.fo_close = ufs_close,
.fo_read = ufs_read,
@@ -890,6 +891,12 @@ ufs_readdir(struct open_file *f, struct dirent *d)
if (error)
return (error);
dp = (struct direct *)buf;
+ /*
+ * Check for corrupt directory entry and bail out rather
+ * than spin forever hoping that the user has other options.
+ */
+ if (dp->d_reclen == 0)
+ return (0);
fp->f_seekp += dp->d_reclen;
} while (dp->d_ino == (ino_t)0);