- error = rdwri(UIO_READ, ip, (caddr_t)dp,
- sizeof (struct direct), off, 1, &count);
- count = sizeof (struct direct) - count;
-#define MINDIRSIZ (sizeof (struct direct) - (MAXNAMLEN + 1))
- if (error || count < MINDIRSIZ || count < DIRSIZ(dp))
+ error = rdwri(UIO_READ, ip, (caddr_t)dp, MINDIRSIZ,
+ off, 1, &count);
+ /*
+ * Since we read MINDIRSIZ, residual must
+ * be 0 unless we're at end of file.
+ */
+ if (error || count != 0)