diff options
author | Rob Landley | 2006-06-13 16:09:16 +0000 |
---|---|---|
committer | Rob Landley | 2006-06-13 16:09:16 +0000 |
commit | c4b673994e5e6f358b80fa3eef89e1cc26f60cee (patch) | |
tree | 7ac1ea3670c886924e49dae580c92cc9e21fb3d8 /archival/uncompress.c | |
parent | fd8409f8c5868d15a427f1e042352e7fc5372e35 (diff) | |
download | busybox-c4b673994e5e6f358b80fa3eef89e1cc26f60cee.zip busybox-c4b673994e5e6f358b80fa3eef89e1cc26f60cee.tar.gz |
Use xstat() instead of if(stat()) die()
Diffstat (limited to 'archival/uncompress.c')
-rw-r--r-- | archival/uncompress.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/archival/uncompress.c b/archival/uncompress.c index c47436e..b282fe8 100644 --- a/archival/uncompress.c +++ b/archival/uncompress.c @@ -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; |