* permissions on symlinks, so a failure here has no
* impact.
*/
- if (lchmod(a->name, mode) != 0) {
+ if (lchmod(a->name, (mode_t)mode) != 0) {
switch (errno) {
case ENOTSUP:
case ENOSYS:
*/
#ifdef HAVE_FCHMOD
if (a->fd >= 0)
- r2 = fchmod(a->fd, mode);
+ r2 = fchmod(a->fd, (mode_t)mode);
else
#endif
/* If this platform lacks fchmod(), then
* we'll just use chmod(). */
- r2 = chmod(a->name, mode);
+ r2 = chmod(a->name, (mode_t)mode);
if (r2 != 0) {
archive_set_error(&a->archive, errno,
assertion_chmod(const char *file, int line, const char *pathname, int mode)
{
assertion_count(file, line);
- if (chmod(pathname, mode) == 0)
+ if (chmod(pathname, (mode_t)mode) == 0)
return (1);
failure_start(file, line, "chmod(\"%s\", %4.o)", pathname,
(unsigned int)mode);
if (0 == _mkdir(dirname))
return (1);
#else
- if (0 == mkdir(dirname, mode)) {
- if (0 == chmod(dirname, mode)) {
+ if (0 == mkdir(dirname, (mode_t)mode)) {
+ if (0 == chmod(dirname, (mode_t)mode)) {
assertion_file_mode(file, line, dirname, mode);
return (1);
}
return (0);
}
#ifdef HAVE_FCHMOD
- if (0 != fchmod(fd, mode))
+ if (0 != fchmod(fd, (mode_t)mode))
#else
- if (0 != chmod(path, mode))
+ if (0 != chmod(path, (mode_t)mode))
#endif
{
failure_start(file, line, "Could not chmod %s", path);
assertion_count(file, line);
(void)file; /* UNUSED */
(void)line; /* UNUSED */
- umask(mask);
+ umask((mode_t)mask);
return (1);
}
char logfilename[64];
int failures_before = failures;
int skips_before = skips;
- int oldumask;
+ mode_t oldumask;
switch (verbosity) {
case VERBOSITY_SUMMARY_ONLY: /* No per-test reports at all */
*/
(void)unlink(path);
}
- if (mkdir(path, mode) != 0 && errno != EEXIST)
+ if (mkdir(path, (mode_t)mode) != 0 && errno != EEXIST)
error("mkdir('%s')", path);
}
error("symlink('%s')", *path);
info(" extracting: %s -> %s\n", *path, linkname);
#ifdef HAVE_LCHMOD
- if (lchmod(*path, mode) != 0)
+ if (lchmod(*path, (mode_t)mode) != 0)
warning("Cannot set mode for '%s'", *path);
#endif
/* set access and modification time */