aboutsummaryrefslogtreecommitdiff
path: root/archival/gunzip.c
diff options
context:
space:
mode:
Diffstat (limited to 'archival/gunzip.c')
-rw-r--r--archival/gunzip.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/archival/gunzip.c b/archival/gunzip.c
index 7b939290b..35449b04d 100644
--- a/archival/gunzip.c
+++ b/archival/gunzip.c
@@ -137,11 +137,8 @@ int gunzip_main(int argc, char **argv)
bb_error_msg_and_die("Invalid extension");
}
- /* Open output file */
- dst_fd = bb_xopen(new_path, O_WRONLY | O_CREAT);
-
- /* Set permissions on the file */
- chmod(new_path, stat_buf.st_mode);
+ /* Open output file (with correct permissions) */
+ dst_fd = bb_xopen3(new_path, O_WRONLY | O_CREAT, stat_buf.st_mode);
/* If unzip succeeds remove the old file */
delete_path = old_path;