From 054bc00b4c0c257f6baf6d7145b270c7283fe51e Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Thu, 26 Aug 2010 11:54:51 -0700 Subject: [PATCH] Add linux compatibility Resolve minor Linux compatibility issues. Signed-off-by: Brian Behlendorf --- lib/libzfs/libzfs_diff.c | 4 ++++ module/zfs/include/sys/zfs_znode.h | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/libzfs/libzfs_diff.c b/lib/libzfs/libzfs_diff.c index 31e18aad27..8140a703a2 100644 --- a/lib/libzfs/libzfs_diff.c +++ b/lib/libzfs/libzfs_diff.c @@ -160,18 +160,22 @@ print_what(FILE *fp, mode_t what) case S_IFDIR: symbol = '/'; break; +#ifdef S_IFDOOR case S_IFDOOR: symbol = '>'; break; +#endif case S_IFIFO: symbol = '|'; break; case S_IFLNK: symbol = '@'; break; +#ifdef S_IFPORT case S_IFPORT: symbol = 'P'; break; +#endif case S_IFSOCK: symbol = '='; break; diff --git a/module/zfs/include/sys/zfs_znode.h b/module/zfs/include/sys/zfs_znode.h index b2477eddba..aa1f449acf 100644 --- a/module/zfs/include/sys/zfs_znode.h +++ b/module/zfs/include/sys/zfs_znode.h @@ -149,9 +149,12 @@ extern "C" { /* * Convert mode bits (zp_mode) to BSD-style DT_* values for storing in - * the directory entries. + * the directory entries. On Linux systems this value is already + * defined correctly as part of the /usr/include/dirent.h header file. */ +#ifndef IFTODT #define IFTODT(mode) (((mode) & S_IFMT) >> 12) +#endif /* * The directory entry has the type (currently unused on Solaris) in the