aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2019-03-12 13:47:44 +0000
committerRon Yorston <rmy@pobox.com>2019-03-12 13:47:44 +0000
commitfd0e6a01a68047e959ef13f3161ce302b438d2b1 (patch)
treec9f15afd1220835af46ddf8e72c077c80edbf005 /coreutils
parentdb255bbadf9c6b219b29d06d4958fbd7967eb8b4 (diff)
parent2452247ea33c1c70263bf4cbc11b3170366ff2ea (diff)
downloadbusybox-w32-fd0e6a01a68047e959ef13f3161ce302b438d2b1.tar.gz
busybox-w32-fd0e6a01a68047e959ef13f3161ce302b438d2b1.tar.bz2
busybox-w32-fd0e6a01a68047e959ef13f3161ce302b438d2b1.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/dd.c16
-rw-r--r--coreutils/du.c4
-rw-r--r--coreutils/stty.c18
3 files changed, 18 insertions, 20 deletions
diff --git a/coreutils/dd.c b/coreutils/dd.c
index e0af8f4a3..2d91f77ef 100644
--- a/coreutils/dd.c
+++ b/coreutils/dd.c
@@ -59,7 +59,7 @@
59//usage: "[if=FILE] [of=FILE] [" IF_FEATURE_DD_IBS_OBS("ibs=N obs=N/") "bs=N] [count=N] [skip=N] [seek=N]\n" 59//usage: "[if=FILE] [of=FILE] [" IF_FEATURE_DD_IBS_OBS("ibs=N obs=N/") "bs=N] [count=N] [skip=N] [seek=N]\n"
60//usage: IF_FEATURE_DD_IBS_OBS( 60//usage: IF_FEATURE_DD_IBS_OBS(
61//usage: " [conv=notrunc|noerror|sync|fsync]\n" 61//usage: " [conv=notrunc|noerror|sync|fsync]\n"
62//usage: " [iflag=skip_bytes|fullblock] [oflag=seek_bytes]" 62//usage: " [iflag=skip_bytes|fullblock] [oflag=seek_bytes|append]"
63//usage: ) 63//usage: )
64//usage:#define dd_full_usage "\n\n" 64//usage:#define dd_full_usage "\n\n"
65//usage: "Copy a file with converting and formatting\n" 65//usage: "Copy a file with converting and formatting\n"
@@ -84,6 +84,7 @@
84//usage: "\n iflag=skip_bytes skip=N is in bytes" 84//usage: "\n iflag=skip_bytes skip=N is in bytes"
85//usage: "\n iflag=fullblock Read full blocks" 85//usage: "\n iflag=fullblock Read full blocks"
86//usage: "\n oflag=seek_bytes seek=N is in bytes" 86//usage: "\n oflag=seek_bytes seek=N is in bytes"
87//usage: "\n oflag=append Open output file in append mode"
87//usage: ) 88//usage: )
88//usage: IF_FEATURE_DD_STATUS( 89//usage: IF_FEATURE_DD_STATUS(
89//usage: "\n status=noxfer Suppress rate output" 90//usage: "\n status=noxfer Suppress rate output"
@@ -143,11 +144,12 @@ enum {
143 /* start of output flags */ 144 /* start of output flags */
144 FLAG_OFLAG_SHIFT = 7, 145 FLAG_OFLAG_SHIFT = 7,
145 FLAG_SEEK_BYTES = (1 << 7) * ENABLE_FEATURE_DD_IBS_OBS, 146 FLAG_SEEK_BYTES = (1 << 7) * ENABLE_FEATURE_DD_IBS_OBS,
147 FLAG_APPEND = (1 << 8) * ENABLE_FEATURE_DD_IBS_OBS,
146 /* end of output flags */ 148 /* end of output flags */
147 FLAG_TWOBUFS = (1 << 8) * ENABLE_FEATURE_DD_IBS_OBS, 149 FLAG_TWOBUFS = (1 << 9) * ENABLE_FEATURE_DD_IBS_OBS,
148 FLAG_COUNT = 1 << 9, 150 FLAG_COUNT = 1 << 10,
149 FLAG_STATUS_NONE = 1 << 10, 151 FLAG_STATUS_NONE = 1 << 11,
150 FLAG_STATUS_NOXFER = 1 << 11, 152 FLAG_STATUS_NOXFER = 1 << 12,
151}; 153};
152 154
153static void dd_output_status(int UNUSED_PARAM cur_signal) 155static void dd_output_status(int UNUSED_PARAM cur_signal)
@@ -270,7 +272,7 @@ int dd_main(int argc UNUSED_PARAM, char **argv)
270 static const char iflag_words[] ALIGN1 = 272 static const char iflag_words[] ALIGN1 =
271 "skip_bytes\0""fullblock\0"; 273 "skip_bytes\0""fullblock\0";
272 static const char oflag_words[] ALIGN1 = 274 static const char oflag_words[] ALIGN1 =
273 "seek_bytes\0"; 275 "seek_bytes\0append\0";
274#endif 276#endif
275#if ENABLE_FEATURE_DD_STATUS 277#if ENABLE_FEATURE_DD_STATUS
276 static const char status_words[] ALIGN1 = 278 static const char status_words[] ALIGN1 =
@@ -459,6 +461,8 @@ int dd_main(int argc UNUSED_PARAM, char **argv)
459 461
460 if (!seek && !(G.flags & FLAG_NOTRUNC)) 462 if (!seek && !(G.flags & FLAG_NOTRUNC))
461 oflag |= O_TRUNC; 463 oflag |= O_TRUNC;
464 if (G.flags & FLAG_APPEND)
465 oflag |= O_APPEND;
462 466
463 xmove_fd(xopen(outfile, oflag), ofd); 467 xmove_fd(xopen(outfile, oflag), ofd);
464 468
diff --git a/coreutils/du.c b/coreutils/du.c
index 0615a6e49..4fd09a8ee 100644
--- a/coreutils/du.c
+++ b/coreutils/du.c
@@ -290,11 +290,11 @@ int du_main(int argc UNUSED_PARAM, char **argv)
290 total = 0; 290 total = 0;
291 do { 291 do {
292 total += du(*argv); 292 total += du(*argv);
293 /* otherwise du /dir /dir won't show /dir twice: */
294 reset_ino_dev_hashtable();
295 G.slink_depth = slink_depth_save; 293 G.slink_depth = slink_depth_save;
296 } while (*++argv); 294 } while (*++argv);
297 295
296 if (ENABLE_FEATURE_CLEAN_UP)
297 reset_ino_dev_hashtable();
298 if (opt & OPT_c_total) 298 if (opt & OPT_c_total)
299 print(total, "total"); 299 print(total, "total");
300 300
diff --git a/coreutils/stty.c b/coreutils/stty.c
index 6251f2aef..d1309f9aa 100644
--- a/coreutils/stty.c
+++ b/coreutils/stty.c
@@ -5,18 +5,7 @@
5 * 5 *
6 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 6 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
7 */ 7 */
8/* Usage: stty [-ag] [-F device] [setting...] 8/* David MacKenzie <djm@gnu.ai.mit.edu>
9 *
10 * Options:
11 * -a Write all current settings to stdout in human-readable form.
12 * -g Write all current settings to stdout in stty-readable form.
13 * -F Open and use the specified device instead of stdin
14 *
15 * If no args are given, write to stdout the baud rate and settings that
16 * have been changed from their defaults. Mode reading and changes
17 * are done on the specified device, or stdin if none was specified.
18 *
19 * David MacKenzie <djm@gnu.ai.mit.edu>
20 * 9 *
21 * Special for busybox ported by Vladimir Oleynik <dzo@simtreas.ru> 2001 10 * Special for busybox ported by Vladimir Oleynik <dzo@simtreas.ru> 2001
22 */ 11 */
@@ -40,6 +29,11 @@
40//usage: "\n -g Print in stty-readable form" 29//usage: "\n -g Print in stty-readable form"
41//usage: "\n [SETTING] See manpage" 30//usage: "\n [SETTING] See manpage"
42 31
32/* If no args are given, write to stdout the baud rate and settings that
33 * have been changed from their defaults. Mode reading and changes
34 * are done on the specified device, or stdin if none was specified.
35 */
36
43#include "libbb.h" 37#include "libbb.h"
44#include "common_bufsiz.h" 38#include "common_bufsiz.h"
45 39