- use bb_msg_{read,write}_error where appropriate.
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Sat, 3 Jun 2006 22:45:37 +0000 (22:45 -0000)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Sat, 3 Jun 2006 22:45:37 +0000 (22:45 -0000)
   text    data     bss     dec     hex filename
 825015    9100  645216 1479331  1692a3 busybox.old
 824919    9100  645216 1479235  169243 busybox

archival/gzip.c
coreutils/tail.c
networking/tftp.c
networking/wget.c
patches/tftp_timeout_multicast.diff
util-linux/fdformat.c

index 4f60c6b244634e7fe276b32a2084be835ce5ed32..91b2948917f5658b6ecce5411b5ae3f86711cfd2 100644 (file)
@@ -324,7 +324,7 @@ static void write_buf(int fd, void *buf, unsigned cnt)
        unsigned n;
 
        while ((n = write(fd, buf, cnt)) != cnt) {
-               if (n == (unsigned) (-1)) bb_error_msg_and_die("can't write");
+               if (n == (unsigned) (-1)) bb_error_msg_and_die(bb_msg_write_error);
                cnt -= n;
                buf = (void *) ((char *) buf + n);
        }
index 48abc4b847c7460b278fc5b0ae89a34c2a6f9118..e63406e3155631d1045cd43889718b28202fa6e5 100644 (file)
@@ -70,7 +70,7 @@ static ssize_t tail_read(int fd, char *buf, size_t count)
                end = sbuf.st_size;
        lseek(fd, end < current ? 0 : current, SEEK_SET);
        if ((r = safe_read(fd, buf, count)) < 0) {
-               bb_perror_msg("read");
+               bb_perror_msg(bb_msg_read_error);
                status = EXIT_FAILURE;
        }
 
index bdba16727bf27da7dc62c7d6330285be0f8ea3b2..73a5adae5171cfc1eb52ce538339e3b38196c23a 100644 (file)
@@ -266,7 +266,7 @@ static inline int tftp(const int cmd, const struct hostent *host,
                                len = bb_full_read(localfd, cp, tftp_bufsize - 4);
 
                                if (len < 0) {
-                                       bb_perror_msg("read");
+                                       bb_perror_msg(bb_msg_read_error);
                                        break;
                                }
 
@@ -443,7 +443,7 @@ static inline int tftp(const int cmd, const struct hostent *host,
                                len = bb_full_write(localfd, &buf[4], len - 4);
 
                                if (len < 0) {
-                                       bb_perror_msg("write");
+                                       bb_perror_msg(bb_msg_write_error);
                                        break;
                                }
 
index 6cab1ba46f8cd56394739fc5482e1e82aa464ebb..4b5b3192dc53ff830b511bac7bf92809ed3c5499 100644 (file)
@@ -512,7 +512,7 @@ read_response:
        do {
                while ((filesize > 0 || !got_clen) && (n = safe_fread(buf, 1, ((chunked || got_clen) && (filesize < sizeof(buf)) ? filesize : sizeof(buf)), dfp)) > 0) {
                        if (safe_fwrite(buf, 1, n, output) != n) {
-                               bb_perror_msg_and_die("write error");
+                               bb_perror_msg_and_die(bb_msg_write_error);
                        }
 #ifdef CONFIG_FEATURE_WGET_STATUSBAR
                        statbytes+=n;
@@ -532,7 +532,7 @@ read_response:
                }
 
                if (n == 0 && ferror(dfp)) {
-                       bb_perror_msg_and_die("network read error");
+                       bb_perror_msg_and_die(bb_msg_read_error);
                }
        } while (chunked);
 #ifdef CONFIG_FEATURE_WGET_STATUSBAR
index ca431fc60370f9c458b3eeb6213e70187075a051..5147a6714d285f0a7c9a57f5247c494443c3aa4d 100644 (file)
@@ -848,7 +848,7 @@ diff -u -r1.25 tftp.c
 +                                      lseek(localfd, bn*(tftp_bufsize-4), SEEK_SET);
 +                                      len = write(localfd, &buf[4], len-4);
 +                                      if (len < 0) {
-+                                              bb_perror_msg("write");
++                                              bb_perror_msg(bb_msg_write_error);
 +                                              break;
 +                                      }
 +                                      bit_set(bn, mcblockmap);
index 5772e13090fcd1a5aec1fa25180de86a7012caef..69128083358f596d7cdbc162818fc5cff7730240 100644 (file)
@@ -133,7 +133,7 @@ int fdformat_main(int argc,char **argv)
                        print_and_flush("%3d\b\b\b", cyl);
                        if((read_bytes = safe_read(fd,data,n))!= n ) {
                                if(read_bytes < 0) {
-                                       bb_perror_msg("Read: ");
+                                       bb_perror_msg(bb_msg_read_error);
                                }
                                bb_error_msg_and_die("Problem reading cylinder %d, expected %d, read %d", cyl, n, read_bytes);
                        }