diff options
Diffstat (limited to 'archival/bunzip2.c')
-rw-r--r-- | archival/bunzip2.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/archival/bunzip2.c b/archival/bunzip2.c index d5c06f4fd..eb5238cd4 100644 --- a/archival/bunzip2.c +++ b/archival/bunzip2.c | |||
@@ -41,7 +41,7 @@ int bunzip2_main(int argc, char **argv) | |||
41 | char *delete_name = NULL; | 41 | char *delete_name = NULL; |
42 | 42 | ||
43 | /* if called as bzcat */ | 43 | /* if called as bzcat */ |
44 | if (strcmp(applet_name, "bzcat") == 0) | 44 | if (strcmp(bb_applet_name, "bzcat") == 0) |
45 | flags |= bunzip_to_stdout; | 45 | flags |= bunzip_to_stdout; |
46 | 46 | ||
47 | while ((opt = getopt(argc, argv, "cfh")) != -1) { | 47 | while ((opt = getopt(argc, argv, "cfh")) != -1) { |
@@ -54,7 +54,7 @@ int bunzip2_main(int argc, char **argv) | |||
54 | break; | 54 | break; |
55 | case 'h': | 55 | case 'h': |
56 | default: | 56 | default: |
57 | show_usage(); /* exit's inside usage */ | 57 | bb_show_usage(); /* exit's inside usage */ |
58 | } | 58 | } |
59 | } | 59 | } |
60 | 60 | ||
@@ -64,23 +64,23 @@ int bunzip2_main(int argc, char **argv) | |||
64 | src_fd = fileno(stdin); | 64 | src_fd = fileno(stdin); |
65 | } else { | 65 | } else { |
66 | /* Open input file */ | 66 | /* Open input file */ |
67 | src_fd = xopen(argv[optind], O_RDONLY); | 67 | src_fd = bb_xopen(argv[optind], O_RDONLY); |
68 | 68 | ||
69 | save_name = xstrdup(argv[optind]); | 69 | save_name = bb_xstrdup(argv[optind]); |
70 | if (strcmp(save_name + strlen(save_name) - 4, ".bz2") != 0) | 70 | if (strcmp(save_name + strlen(save_name) - 4, ".bz2") != 0) |
71 | error_msg_and_die("Invalid extension"); | 71 | bb_error_msg_and_die("Invalid extension"); |
72 | save_name[strlen(save_name) - 4] = '\0'; | 72 | save_name[strlen(save_name) - 4] = '\0'; |
73 | } | 73 | } |
74 | 74 | ||
75 | /* Check that the input is sane. */ | 75 | /* Check that the input is sane. */ |
76 | if (isatty(src_fd) && (flags & bunzip_force) == 0) { | 76 | if (isatty(src_fd) && (flags & bunzip_force) == 0) { |
77 | error_msg_and_die("compressed data not read from terminal. Use -f to force it."); | 77 | bb_error_msg_and_die("compressed data not read from terminal. Use -f to force it."); |
78 | } | 78 | } |
79 | 79 | ||
80 | if (flags & bunzip_to_stdout) { | 80 | if (flags & bunzip_to_stdout) { |
81 | dst_fd = fileno(stdout); | 81 | dst_fd = fileno(stdout); |
82 | } else { | 82 | } else { |
83 | dst_fd = xopen(save_name, O_WRONLY | O_CREAT); | 83 | dst_fd = bb_xopen(save_name, O_WRONLY | O_CREAT); |
84 | } | 84 | } |
85 | 85 | ||
86 | if (uncompressStream(src_fd, dst_fd)) { | 86 | if (uncompressStream(src_fd, dst_fd)) { |
@@ -96,7 +96,7 @@ int bunzip2_main(int argc, char **argv) | |||
96 | } | 96 | } |
97 | 97 | ||
98 | if ((delete_name) && (unlink(delete_name) < 0)) { | 98 | if ((delete_name) && (unlink(delete_name) < 0)) { |
99 | error_msg_and_die("Couldn't remove %s", delete_name); | 99 | bb_error_msg_and_die("Couldn't remove %s", delete_name); |
100 | } | 100 | } |
101 | 101 | ||
102 | return status; | 102 | return status; |