88 |
if (n2 != n) { |
if (n2 != n) { |
89 |
if (n2 >= 0) |
if (n2 >= 0) |
90 |
errno = 0; /* prevent bogus error message */ |
errno = 0; /* prevent bogus error message */ |
91 |
bb_perror_msg(n2 >= 0 ? "short write" : "write error"); |
bb_perror_msg(n2 >= 0 ? "short write" : bb_msg_write_error); |
92 |
return -1; |
return -1; |
93 |
} |
} |
94 |
} |
} |
102 |
} |
} |
103 |
|
|
104 |
static |
static |
105 |
IF_DESKTOP(long long) int compressStream(unpack_info_t *info UNUSED_PARAM) |
IF_DESKTOP(long long) int FAST_FUNC compressStream(unpack_info_t *info UNUSED_PARAM) |
106 |
{ |
{ |
107 |
IF_DESKTOP(long long) int total; |
IF_DESKTOP(long long) int total; |
108 |
ssize_t count; |
ssize_t count; |
118 |
while (1) { |
while (1) { |
119 |
count = full_read(STDIN_FILENO, rbuf, IOBUF_SIZE); |
count = full_read(STDIN_FILENO, rbuf, IOBUF_SIZE); |
120 |
if (count < 0) { |
if (count < 0) { |
121 |
bb_perror_msg("read error"); |
bb_perror_msg(bb_msg_read_error); |
122 |
total = -1; |
total = -1; |
123 |
break; |
break; |
124 |
} |
} |
135 |
return total; |
return total; |
136 |
} |
} |
137 |
|
|
|
static |
|
|
char* make_new_name_bzip2(char *filename) |
|
|
{ |
|
|
return xasprintf("%s.bz2", filename); |
|
|
} |
|
|
|
|
138 |
int bzip2_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
int bzip2_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
139 |
int bzip2_main(int argc UNUSED_PARAM, char **argv) |
int bzip2_main(int argc UNUSED_PARAM, char **argv) |
140 |
{ |
{ |
175 |
|
|
176 |
argv += optind; |
argv += optind; |
177 |
option_mask32 &= 0x7; /* ignore all except -cfv */ |
option_mask32 &= 0x7; /* ignore all except -cfv */ |
178 |
return bbunpack(argv, make_new_name_bzip2, compressStream); |
return bbunpack(argv, compressStream, append_ext, "bz2"); |
179 |
} |
} |