Add linux compatibility
authorBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 26 Aug 2010 18:54:51 +0000 (11:54 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 31 Aug 2010 20:41:59 +0000 (13:41 -0700)
Resolve minor Linux compatibility issues.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
lib/libzfs/libzfs_diff.c
module/zfs/include/sys/zfs_znode.h

index 31e18aa..8140a70 100644 (file)
@@ -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;
index b2477ed..aa1f449 100644 (file)
@@ -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