fprintf(stderr, "open(%s, O_RDWR) did not fail\n", path);
fail++;
close(fd);
- } else if (errno != EACCES) {
- fprintf(stderr, "open(%s, O_RDWR) did not set errno == EACCES\n", path);
+ } else if (errno != EACCES && errno != EPERM) {
+ fprintf(stderr, "open(%s, O_RDWR) did not set errno == EACCES or EPERM\n", path);
fail++;
}
fprintf(stderr, "open(%s, O_WRONLY) did not fail\n", path);
fail++;
close(fd);
- } else if (errno != EACCES) {
- fprintf(stderr, "open(%s, O_WRONLY) did not set errno == EACCES\n", path);
+ } else if (errno != EACCES && errno != EPERM) {
+ fprintf(stderr, "open(%s, O_WRONLY) did not set errno == EACCES or EPERM\n", path);
fail++;
}
fprintf(stderr, "open(%s, O_RDWR|O_TRUNC) did not fail\n", path);
fail++;
close(fd);
- } else if (errno != EACCES) {
- fprintf(stderr, "open(%s, O_RDWR|O_TRUNC) did not set errno == EACCES\n", path);
+ } else if (errno != EACCES && errno != EPERM) {
+ fprintf(stderr, "open(%s, O_RDWR|O_TRUNC) did not set errno == EACCES or EPERM\n", path);
fail++;
}
fprintf(stderr, "open(%s, O_WRONLY|O_TRUNC) did not fail\n", path);
fail++;
close(fd);
- } else if (errno != EACCES) {
- fprintf(stderr, "open(%s, O_WRONLY|O_TRUNC did not set errno == EACCES\n", path);
+ } else if (errno != EACCES && errno != EPERM) {
+ fprintf(stderr, "open(%s, O_WRONLY|O_TRUNC did not set errno == EACCES or EPERM\n", path);
fail++;
}
fprintf(stderr, "open(%s, O_RDWR|O_APPEND) did not fail\n", path);
fail++;
close(fd);
- } else if (errno != EACCES) {
- fprintf(stderr, "open(%s, O_RDWR|O_APPEND) did not set errno == EACCES\n", path);
+ } else if (errno != EACCES && errno != EPERM) {
+ fprintf(stderr, "open(%s, O_RDWR|O_APPEND) did not set errno == EACCES or EPERM\n", path);
fail++;
}
fprintf(stderr, "open(%s, O_WRONLY|O_APPEND) did not fail\n", path);
fail++;
close(fd);
- } else if (errno != EACCES) {
- fprintf(stderr, "open(%s, O_WRONLY|O_APPEND) did not set errno == EACCES\n", path);
+ } else if (errno != EACCES && errno != EPERM) {
+ fprintf(stderr, "open(%s, O_WRONLY|O_APPEND) did not set errno == EACCES or EPERM\n", path);
fail++;
}
fprintf(stderr, "open(%s, O_RDWR|O_APPEND|O_TRUNC) did not fail\n", path);
fail++;
close(fd);
- } else if (errno != EACCES) {
- fprintf(stderr, "open(%s, O_RDWR|O_APPEND|O_TRUNC) did not set errno == EACCES\n", path);
+ } else if (errno != EACCES && errno != EPERM) {
+ fprintf(stderr, "open(%s, O_RDWR|O_APPEND|O_TRUNC) did not set errno == EACCES or EPERM\n", path);
fail++;
}
fprintf(stderr, "open(%s, O_WRONLY|O_APPEND|O_TRUNC) did not fail\n", path);
fail++;
close(fd);
- } else if (errno != EACCES) {
- fprintf(stderr, "open(%s, O_WRONLY|O_APPEND|O_TRUNC) did not set errno == EACCES\n", path);
+ } else if (errno != EACCES && errno != EPERM) {
+ fprintf(stderr, "open(%s, O_WRONLY|O_APPEND|O_TRUNC) did not set errno == EACCES or EPERM\n", path);
fail++;
}
fprintf(stderr, "jdm_open(%s, O_RDWR) did not fail\n", path);
fail++;
close(fd);
- } else if (errno != EACCES) {
+ } else if (errno != EACCES && errno != EPERM) {
perror("jdm_open");
- fprintf(stderr, "jdm_open(%s, O_RDWR) did not set errno == EACCES\n", path);
+ fprintf(stderr, "jdm_open(%s, O_RDWR) did not set errno == EACCES or EPERM\n", path);
fail++;
}
fprintf(stderr, "jdm_open(%s, O_WRONLY) did not fail\n", path);
fail++;
close(fd);
- } else if (errno != EACCES) {
- fprintf(stderr, "jdm_open(%s, O_WRONLY) did not set errno == EACCES\n", path);
+ } else if (errno != EACCES && errno != EPERM) {
+ fprintf(stderr, "jdm_open(%s, O_WRONLY) did not set errno == EACCES or EPERM\n", path);
fail++;
}
fprintf(stderr, "jdm_open(%s, O_RDWR|O_TRUNC) did not fail\n", path);
fail++;
close(fd);
- } else if (errno != EACCES) {
- fprintf(stderr, "jdm_open(%s, O_RDWR|O_TRUNC) did not set errno == EACCES\n", path);
+ } else if (errno != EACCES && errno != EPERM) {
+ fprintf(stderr, "jdm_open(%s, O_RDWR|O_TRUNC) did not set errno == EACCES or EPERM\n", path);
fail++;
}
fprintf(stderr, "jdm_open(%s, O_WRONLY|O_TRUNC) did not fail\n", path);
fail++;
close(fd);
- } else if (errno != EACCES) {
- fprintf(stderr, "jdm_open(%s, O_WRONLY|O_TRUNC did not set errno == EACCES\n", path);
+ } else if (errno != EACCES && errno != EPERM) {
+ fprintf(stderr, "jdm_open(%s, O_WRONLY|O_TRUNC did not set errno == EACCES or EPERM\n", path);
fail++;
}
fprintf(stderr, "jdm_open(%s, O_RDWR|O_APPEND) did not fail\n", path);
fail++;
close(fd);
- } else if (errno != EACCES) {
- fprintf(stderr, "jdm_open(%s, O_RDWR|O_APPEND) did not set errno == EACCES\n", path);
+ } else if (errno != EACCES && errno != EPERM) {
+ fprintf(stderr, "jdm_open(%s, O_RDWR|O_APPEND) did not set errno == EACCES or EPERM\n", path);
fail++;
}
fprintf(stderr, "jdm_open(%s, O_WRONLY|O_APPEND) did not fail\n", path);
fail++;
close(fd);
- } else if (errno != EACCES) {
- fprintf(stderr, "jdm_open(%s, O_WRONLY|O_APPEND) did not set errno == EACCES\n", path);
+ } else if (errno != EACCES && errno != EPERM) {
+ fprintf(stderr, "jdm_open(%s, O_WRONLY|O_APPEND) did not set errno == EACCES or EPERM\n", path);
fail++;
}
fprintf(stderr, "jdm_open(%s, O_RDWR|O_APPEND|O_TRUNC) did not fail\n", path);
fail++;
close(fd);
- } else if (errno != EACCES) {
- fprintf(stderr, "jdm_open(%s, O_RDWR|O_APPEND|O_TRUNC) did not set errno == EACCES\n", path);
+ } else if (errno != EACCES && errno != EPERM) {
+ fprintf(stderr, "jdm_open(%s, O_RDWR|O_APPEND|O_TRUNC) did not set errno == EACCES or EPERM\n", path);
fail++;
}
fprintf(stderr, "jdm_open(%s, O_WRONLY|O_APPEND|O_TRUNC) did not fail\n", path);
fail++;
close(fd);
- } else if (errno != EACCES) {
- fprintf(stderr, "jdm_open(%s, O_WRONLY|O_APPEND|O_TRUNC) did not set errno == EACCES\n", path);
+ } else if (errno != EACCES && errno != EPERM) {
+ fprintf(stderr, "jdm_open(%s, O_WRONLY|O_APPEND|O_TRUNC) did not set errno == EACCES or EPERM\n", path);
fail++;
}
}
if (truncate(path, 0) != -1) {
fprintf(stderr, "truncate(%s, 0) did not fail\n", path);
fail++;
- } else if (errno != EACCES) {
- fprintf(stderr, "truncate(%s, 0) did not set errno == EACCES\n", path);
+ } else if (errno != EACCES && errno != EPERM) {
+ fprintf(stderr, "truncate(%s, 0) did not set errno == EACCES or EPERM\n", path);
fail++;
}
if (utime(path, NULL) != -1) {
fprintf(stderr, "utime(%s, NULL) did not fail\n", path);
fail++;
- } else if (errno != EACCES) {
- fprintf(stderr, "utime(%s, NULL) did not set errno == EACCES\n", path);
+ } else if (errno != EACCES && errno != EPERM) {
+ fprintf(stderr, "utime(%s, NULL) did not set errno == EACCES or EPERM\n", path);
fail++;
}
#endif /* TEST_UTIME */
fprintf(stderr, "link(%s, %s) did not fail\n", path, linkpath);
fail++;
unlink(linkpath);
- } else if (errno != EACCES) {
- fprintf(stderr, "link(%s, %s) did not set errno == EACCES\n", path, linkpath);
+ } else if (errno != EACCES && errno != EPERM) {
+ fprintf(stderr, "link(%s, %s) did not set errno == EACCES or EPERM\n", path, linkpath);
fail++;
}
if (symlink(path, linkpath) != -1) {
fprintf(stderr, "symlink(%s, %s) did not fail\n", path, linkpath);
fail++;
unlink(linkpath);
- } else if (errno != EACCES) {
- fprintf(stderr, "symlink(%s, %s) did not set errno == EACCES\n", path, linkpath);
+ } else if (errno != EACCES && errno != EPERM) {
+ fprintf(stderr, "symlink(%s, %s) did not set errno == EACCES or EPERM\n", path, linkpath);
fail++;
}
free(linkpath);
fprintf(stderr, "rename(%s, %s) did not fail\n", path, linkpath);
fail++;
rename(linkpath, path);
- } else if (errno != EACCES) {
- fprintf(stderr, "rename(%s, %s) did not set errno == EACCES\n", path, linkpath);
+ } else if (errno != EACCES && errno != EPERM) {
+ fprintf(stderr, "rename(%s, %s) did not set errno == EACCES or EPERM\n", path, linkpath);
fail++;
}
free(linkpath);
if (unlink(path) != -1) {
fprintf(stderr, "unlink(%s) did not fail\n", path);
fail++;
- } else if (errno != EACCES) {
- fprintf(stderr, "unlink(%s) did not set errno == EACCES\n", path);
+ } else if (errno != EACCES && errno != EPERM) {
+ fprintf(stderr, "unlink(%s) did not set errno == EACCES or EPERM\n", path);
fail++;
}
fprintf(stderr, "open(%s, O_RDWR|O_CREAT, 0666) did not fail\n", path);
fail++;
unlink(path);
- } else if (errno != EACCES) {
- fprintf(stderr, "open(%s, O_RDWR|O_CREAT, 0666) did not set errno == EACCES\n", path);
+ } else if (errno != EACCES && errno != EPERM) {
+ fprintf(stderr, "open(%s, O_RDWR|O_CREAT, 0666) did not set errno == EACCES or EPERM\n", path);
fail++;
}
if (!getuid()) {
fprintf(stderr, "mknod(%s, S_IFCHR|0666, %lld) did not fail\n", path, (long long int)st.st_rdev);
fail++;
unlink(path);
- } else if (errno != EACCES) {
- fprintf(stderr, "mknod(%s, S_IFCHR|0666, %lld) did not set errno == EACCESS\n", path, (long long int)st.st_rdev);
+ } else if (errno != EACCES && errno != EPERM) {
+ fprintf(stderr, "mknod(%s, S_IFCHR|0666, %lld) did not set errno == EACCES or EPERM\n", path, (long long int)st.st_rdev);
fail++;
}
}
fprintf(stderr, "mkdir(%s, 0777) did not fail\n", path);
fail++;
rmdir(path);
- } else if (errno != EACCES) {
- fprintf(stderr, "mkdir(%s, 0777) did not set errno == EACCES\n", path);
+ } else if (errno != EACCES && errno != EPERM) {
+ fprintf(stderr, "mkdir(%s, 0777) did not set errno == EACCES or EPERM\n", path);
fail++;
}
if (rmdir(path) != -1) {
fprintf(stderr, "rmdir(%s) did not fail\n", path);
fail++;
- } else if (errno != EACCES) {
- fprintf(stderr, "rmdir(%s) did not set errno == EACCES\n", path);
+ } else if (errno != EACCES && errno != EPERM) {
+ fprintf(stderr, "rmdir(%s) did not set errno == EACCES or EPERM\n", path);
fail++;
}
if (utime(path, NULL) != -1) {
fprintf(stderr, "utime(%s, NULL) did not fail\n", path);
fail++;
- } else if (errno != EACCES) {
- fprintf(stderr, "utime(%s, NULL) did not set errno == EACCES\n", path);
+ } else if (errno != EACCES && errno != EPERM) {
+ fprintf(stderr, "utime(%s, NULL) did not set errno == EACCES or EPERM\n", path);
fail++;
}
#endif /* TEST_UTIME */