aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-03-01 11:48:04 +0000
committerRon Yorston <rmy@pobox.com>2021-03-01 11:48:04 +0000
commite2e8e16b465d34759678b8170c44ce62c5b74eb0 (patch)
treeabc31e3e2c1d0de089ae5e1e6d37672394757af9 /coreutils
parentb5cd41cdf4e6afd475fe34b755f99578e20b08ca (diff)
parent9b6bcfda0e11c0e73a966a77110f6c68425cff34 (diff)
downloadbusybox-w32-e2e8e16b465d34759678b8170c44ce62c5b74eb0.tar.gz
busybox-w32-e2e8e16b465d34759678b8170c44ce62c5b74eb0.tar.bz2
busybox-w32-e2e8e16b465d34759678b8170c44ce62c5b74eb0.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/echo.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/coreutils/echo.c b/coreutils/echo.c
index b3828894c..61ba060ec 100644
--- a/coreutils/echo.c
+++ b/coreutils/echo.c
@@ -97,6 +97,7 @@ int echo_main(int argc UNUSED_PARAM, char **argv)
97#else 97#else
98 char nflag = 1; 98 char nflag = 1;
99 char eflag = 0; 99 char eflag = 0;
100 int err;
100 101
101 while ((arg = *++argv) != NULL) { 102 while ((arg = *++argv) != NULL) {
102 char n, e; 103 char n, e;
@@ -185,13 +186,12 @@ int echo_main(int argc UNUSED_PARAM, char **argv)
185 do_write: 186 do_write:
186 /* Careful to error out on partial writes too (think ENOSPC!) */ 187 /* Careful to error out on partial writes too (think ENOSPC!) */
187 errno = 0; 188 errno = 0;
188 /*r =*/ full_write(STDOUT_FILENO, buffer, out - buffer); 189 err = full_write(STDOUT_FILENO, buffer, out - buffer) != out - buffer;
189 free(buffer); 190 if (err) {
190 if (/*WRONG:r < 0*/ errno) {
191 bb_simple_perror_msg(bb_msg_write_error); 191 bb_simple_perror_msg(bb_msg_write_error);
192 return 1;
193 } 192 }
194 return 0; 193 free(buffer);
194 return err;
195} 195}
196 196
197/* 197/*