Magellan Linux

Diff of /trunk/mkinitrd-magellan/busybox/archival/bzip2.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1122 by niro, Sun May 30 11:32:42 2010 UTC revision 1123 by niro, Wed Aug 18 21:56:57 2010 UTC
# Line 88  IF_DESKTOP(long long) int bz_write(bz_st Line 88  IF_DESKTOP(long long) int bz_write(bz_st
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   }   }
# Line 102  IF_DESKTOP(long long) int bz_write(bz_st Line 102  IF_DESKTOP(long long) int bz_write(bz_st
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;
# Line 118  IF_DESKTOP(long long) int compressStream Line 118  IF_DESKTOP(long long) int compressStream
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   }   }
# Line 135  IF_DESKTOP(long long) int compressStream Line 135  IF_DESKTOP(long long) int compressStream
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  {  {
# Line 181  int bzip2_main(int argc UNUSED_PARAM, ch Line 175  int bzip2_main(int argc UNUSED_PARAM, ch
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  }  }

Legend:
Removed from v.1122  
changed lines
  Added in v.1123