diff options
author | kientzle <kientzle@FreeBSD.org> | 2008-11-17 21:06:17 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2008-11-17 21:06:17 +0000 |
commit | 9aed2614cca33e7b8d6f75ffd760706ebd7d7c64 (patch) | |
tree | f6e035cb2f7a908ae23ba164eec0104c2ba29f1b | |
parent | bbe899b96e388a8b82439f81ed3707e0d9c6070d (diff) | |
download | FreeBSD-src-9aed2614cca33e7b8d6f75ffd760706ebd7d7c64.zip FreeBSD-src-9aed2614cca33e7b8d6f75ffd760706ebd7d7c64.tar.gz |
When running on a filesystem that lacks ACL support,
just SKIP the test, don't report a test failure.
-rw-r--r-- | lib/libarchive/test/test_acl_freebsd.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/libarchive/test/test_acl_freebsd.c b/lib/libarchive/test/test_acl_freebsd.c index 4e0888a..59481fc 100644 --- a/lib/libarchive/test/test_acl_freebsd.c +++ b/lib/libarchive/test/test_acl_freebsd.c @@ -200,19 +200,19 @@ DEFINE_TEST(test_acl_freebsd) /* Create a test file and try to set an ACL on it. */ fd = open("pretest", O_WRONLY | O_CREAT | O_EXCL, 0777); failure("Could not create test file?!"); - n = -1; - if (assert(fd >= 0)) { - n = acl_set_fd(fd, acl); - failure("acl_set_fd(): errno = %d (%s)", - errno, strerror(errno)); - assertEqualInt(0, n); - close(fd); - } + if (!assert(fd >= 0)) + return; - if (fd < 0 || n != 0) { + n = acl_set_fd(fd, acl); + if (n != 0 && errno == EOPNOTSUPP) { + close(fd); skipping("ACL tests require that ACL support be enabled on the filesystem"); return; } + failure("acl_set_fd(): errno = %d (%s)", + errno, strerror(errno)); + assertEqualInt(0, n); + close(fd); /* Create a write-to-disk object. */ assert(NULL != (a = archive_write_disk_new())); |