Use xstat() instead of if(stat()) die()

This commit is contained in:
Rob Landley
2006-06-13 16:09:16 +00:00
parent fd8409f8c5
commit c4b673994e
3 changed files with 5 additions and 13 deletions

View File

@ -61,11 +61,9 @@ int uncompress_main(int argc, char **argv)
*extension = '\0';
/* Open output file */
dst_fd = bb_xopen(uncompressed_file, O_WRONLY | O_CREAT);
/* Set permissions on the file */
stat(compressed_file, &stat_buf);
chmod(uncompressed_file, stat_buf.st_mode);
xstat(compressed_file, &stat_buf);
dst_fd = bb_xopen3(uncompressed_file, O_WRONLY | O_CREAT,
stat_buf.st_mode);
/* If unzip succeeds remove the old file */
delete_path = compressed_file;