diff options
author | kientzle <kientzle@FreeBSD.org> | 2009-04-17 01:06:31 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2009-04-17 01:06:31 +0000 |
commit | 621fee72b361fb219dc90b56c58ec551f03a1072 (patch) | |
tree | 53d4a3656571c490fa7ee297568309894736ba26 /lib/libarchive/test/test_write_disk_failures.c | |
parent | 68cb951cd0d330003aa4564ad6312d927b58c5ae (diff) | |
download | FreeBSD-src-621fee72b361fb219dc90b56c58ec551f03a1072.zip FreeBSD-src-621fee72b361fb219dc90b56c58ec551f03a1072.tar.gz |
Merge lots of test suite updates from libarchive.googlecode.com.
Diffstat (limited to 'lib/libarchive/test/test_write_disk_failures.c')
-rw-r--r-- | lib/libarchive/test/test_write_disk_failures.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/libarchive/test/test_write_disk_failures.c b/lib/libarchive/test/test_write_disk_failures.c index 0d7b894..1befbac 100644 --- a/lib/libarchive/test/test_write_disk_failures.c +++ b/lib/libarchive/test/test_write_disk_failures.c @@ -39,6 +39,7 @@ DEFINE_TEST(test_write_disk_failures) #else struct archive_entry *ae; struct archive *a; + int fd; /* Force the umask to something predictable. */ umask(UMASK); @@ -46,6 +47,15 @@ DEFINE_TEST(test_write_disk_failures) /* A directory that we can't write to. */ assertEqualInt(0, mkdir("dir", 0555)); + /* Can we? */ + fd = open("dir/testfile", O_WRONLY | O_CREAT, 0777); + if (fd >= 0) { + /* Apparently, we can, so the test below won't work. */ + close(fd); + skipping("Can't test writing to non-writable directory"); + return; + } + /* Try to extract a regular file into the directory above. */ assert((ae = archive_entry_new()) != NULL); archive_entry_copy_pathname(ae, "dir/file"); |