This makes unzip to FAT filesystems not exit with error.
This is similar to how the "normal" unzip works.
Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
printf(" creating: %s\n", dst_fn);
}
unzip_create_leading_dirs(dst_fn);
- if (bb_make_directory(dst_fn, dir_mode, 0)) {
+ if (bb_make_directory(dst_fn, dir_mode, FILEUTILS_IGNORE_CHMOD_ERR)) {
xfunc_die();
}
} else {
FILEUTILS_PRESERVE_SECURITY_CONTEXT = 1 << 9, /* -c */
FILEUTILS_SET_SECURITY_CONTEXT = 1 << 10,
#endif
+ FILEUTILS_IGNORE_CHMOD_ERR = 1 << 11,
};
#define FILEUTILS_CP_OPTSTR "pdRfilsLH" IF_SELINUX("c")
extern int remove_file(const char *path, int flags) FAST_FUNC;
* an error. */
if ((mode != -1) && (chmod(path, mode) < 0)) {
fail_msg = "set permissions of";
+ if (flags & FILEUTILS_IGNORE_CHMOD_ERR) {
+ flags = 0;
+ goto print_err;
+ }
break;
}
goto ret0;
*s = c;
} /* while (1) */
- bb_perror_msg("can't %s directory '%s'", fail_msg, path);
flags = -1;
+ print_err:
+ bb_perror_msg("can't %s directory '%s'", fail_msg, path);
goto ret;
ret0:
flags = 0;