From 02112d8ae3d0c07214fb2b132e0eacb4ff39d167 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Tue, 22 May 2012 17:11:46 +0200 Subject: unzip: ignore chmod errors This makes unzip to FAT filesystems not exit with error. This is similar to how the "normal" unzip works. Signed-off-by: Natanael Copa Signed-off-by: Denys Vlasenko --- libbb/make_directory.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'libbb') diff --git a/libbb/make_directory.c b/libbb/make_directory.c index 72303e7..7826b90 100644 --- a/libbb/make_directory.c +++ b/libbb/make_directory.c @@ -107,6 +107,10 @@ int FAST_FUNC bb_make_directory(char *path, long mode, int flags) * 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; @@ -116,8 +120,9 @@ int FAST_FUNC bb_make_directory(char *path, long mode, int flags) *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; -- cgit v1.1