summaryrefslogtreecommitdiff
path: root/ufs/dir.h
diff options
context:
space:
mode:
Diffstat (limited to 'ufs/dir.h')
-rw-r--r--ufs/dir.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/ufs/dir.h b/ufs/dir.h
index 2b1e3469..5730ef44 100644
--- a/ufs/dir.h
+++ b/ufs/dir.h
@@ -70,6 +70,7 @@
* dp->d_ino set to 0.
*/
#define DIRBLKSIZ DEV_BSIZE
+#undef MAXNAMLEN
#define MAXNAMLEN 255
/* Don't call this struct DIRECT because the library defines that
@@ -90,13 +91,13 @@ struct directory_entry {
/* Return the namlen from a struct direct, paying attention to whether
this filesystem supports the type extension */
#if (BYTE_ORDER == LITTLE_ENDIAN)
-#define DIRECT_NAMLEN(dp) (direct_symlink_extension || swab_disk \
- ? (dp)->d_namlen \
- : (dp)->d_type)
+#define DIRECT_NAMLEN(dp) (*(direct_symlink_extension || swab_disk \
+ ? &(dp)->d_namlen \
+ : &(dp)->d_type))
#else
-#define DIRECT_NAMLEN(dp) (!direct_symlink_extension && swab_disk \
- ? (dp)->d_type \
- : (dp)->d_namlen)
+#define DIRECT_NAMLEN(dp) (*(!direct_symlink_extension && swab_disk \
+ ? &(dp)->d_type \
+ : &(dp)->d_namlen))
#endif
/*