#else
struct archive_entry *ae;
struct archive *a;
+ int fd;
/* Force the umask to something predictable. */
umask(UMASK);
/* A directory that we can't write to. */
assertEqualInt(0, mkdir("dir", 0555));
+ /* Can we? */
+ fd = open("dir/testfile", O_WRONLY | O_CREAT);
+ 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");