aboutsummaryrefslogtreecommitdiff
path: root/archival/gunzip.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-08-03 15:41:12 +0000
committerRob Landley <rob@landley.net>2006-08-03 15:41:12 +0000
commitd921b2ecc0d294ad4bf8c7458fc52a60c28727d2 (patch)
treee4a2769349867c441cf2983d83097bb66701a733 /archival/gunzip.c
parent6dce0b6fa79f2d4bb7e9d90e1fbc0f6beb25f855 (diff)
downloadbusybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.gz
busybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.bz2
busybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.zip
Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only had one user), clean up lots of #includes... General cleanup pass. What I've been doing for the last couple days. And it conflicts! I've removed httpd.c from this checkin due to somebody else touching that file. It builds for me. I have to catch a bus. (Now you know why I'm looking forward to Mercurial.)
Diffstat (limited to 'archival/gunzip.c')
-rw-r--r--archival/gunzip.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/archival/gunzip.c b/archival/gunzip.c
index bd6047e13..3a1d1cb61 100644
--- a/archival/gunzip.c
+++ b/archival/gunzip.c
@@ -27,13 +27,6 @@
27 * See the file algorithm.doc for the compression algorithms and file formats. 27 * See the file algorithm.doc for the compression algorithms and file formats.
28 */ 28 */
29 29
30#include <stdlib.h>
31#include <string.h>
32#include <unistd.h>
33#include <sys/types.h>
34#include <sys/stat.h>
35#include <fcntl.h>
36
37#include "busybox.h" 30#include "busybox.h"
38#include "unarchive.h" 31#include "unarchive.h"
39 32
@@ -67,7 +60,7 @@ int gunzip_main(int argc, char **argv)
67 src_fd = STDIN_FILENO; 60 src_fd = STDIN_FILENO;
68 opt |= GUNZIP_OPT_STDOUT; 61 opt |= GUNZIP_OPT_STDOUT;
69 } else { 62 } else {
70 src_fd = bb_xopen(old_path, O_RDONLY); 63 src_fd = xopen(old_path, O_RDONLY);
71 64
72 /* Get the time stamp on the input file. */ 65 /* Get the time stamp on the input file. */
73 xstat(old_path, &stat_buf); 66 xstat(old_path, &stat_buf);
@@ -81,13 +74,13 @@ int gunzip_main(int argc, char **argv)
81 74
82 /* Set output filename and number */ 75 /* Set output filename and number */
83 if (opt & GUNZIP_OPT_TEST) { 76 if (opt & GUNZIP_OPT_TEST) {
84 dst_fd = bb_xopen(bb_dev_null, O_WRONLY); /* why does test use filenum 2 ? */ 77 dst_fd = xopen(bb_dev_null, O_WRONLY); /* why does test use filenum 2 ? */
85 } else if (opt & GUNZIP_OPT_STDOUT) { 78 } else if (opt & GUNZIP_OPT_STDOUT) {
86 dst_fd = STDOUT_FILENO; 79 dst_fd = STDOUT_FILENO;
87 } else { 80 } else {
88 char *extension; 81 char *extension;
89 82
90 new_path = bb_xstrdup(old_path); 83 new_path = xstrdup(old_path);
91 84
92 extension = strrchr(new_path, '.'); 85 extension = strrchr(new_path, '.');
93#ifdef CONFIG_FEATURE_GUNZIP_UNCOMPRESS 86#ifdef CONFIG_FEATURE_GUNZIP_UNCOMPRESS
@@ -105,7 +98,7 @@ int gunzip_main(int argc, char **argv)
105 } 98 }
106 99
107 /* Open output file (with correct permissions) */ 100 /* Open output file (with correct permissions) */
108 dst_fd = bb_xopen3(new_path, O_WRONLY | O_CREAT, stat_buf.st_mode); 101 dst_fd = xopen3(new_path, O_WRONLY | O_CREAT, stat_buf.st_mode);
109 102
110 /* If unzip succeeds remove the old file */ 103 /* If unzip succeeds remove the old file */
111 delete_path = old_path; 104 delete_path = old_path;