Make spl directory setable when building rpms and add --buildroot
[zfs.git] / lib / libzfs / libzfs_diff.c
index 5b3f934..77d5a09 100644 (file)
@@ -141,7 +141,7 @@ stream_bytes(FILE *fp, const char *string)
                if (*string > ' ' && *string != '\\' && *string < '\177')
                        (void) fprintf(fp, "%c", *string++);
                else
-                       (void) fprintf(fp, "\\%03o", *string++);
+                       (void) fprintf(fp, "\\%03o", (unsigned char)*string++);
        }
 }
 
@@ -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;
@@ -426,7 +430,7 @@ differ(void *arg)
 
        if ((ofp = fdopen(di->outputfd, "w")) == NULL) {
                di->zerr = errno;
-               (void) strerror_r(errno, di->errbuf, sizeof (di->errbuf));
+               strncpy(di->errbuf, strerror(errno), sizeof (di->errbuf));
                (void) close(di->datafd);
                return ((void *)-1);
        }
@@ -726,7 +730,7 @@ setup_differ_info(zfs_handle_t *zhp, const char *fromsnap,
 {
        di->zhp = zhp;
 
-       di->cleanupfd = open(ZFS_DEV, O_RDWR|O_EXCL);
+       di->cleanupfd = open(ZFS_DEV, O_RDWR);
        VERIFY(di->cleanupfd >= 0);
 
        if (get_snapshot_names(di, fromsnap, tosnap) != 0)