diff options
| author | Ron Yorston <rmy@pobox.com> | 2019-03-12 13:47:44 +0000 |
|---|---|---|
| committer | Ron Yorston <rmy@pobox.com> | 2019-03-12 13:47:44 +0000 |
| commit | fd0e6a01a68047e959ef13f3161ce302b438d2b1 (patch) | |
| tree | c9f15afd1220835af46ddf8e72c077c80edbf005 | |
| parent | db255bbadf9c6b219b29d06d4958fbd7967eb8b4 (diff) | |
| parent | 2452247ea33c1c70263bf4cbc11b3170366ff2ea (diff) | |
| download | busybox-w32-fd0e6a01a68047e959ef13f3161ce302b438d2b1.tar.gz busybox-w32-fd0e6a01a68047e959ef13f3161ce302b438d2b1.tar.bz2 busybox-w32-fd0e6a01a68047e959ef13f3161ce302b438d2b1.zip | |
Merge branch 'busybox' into merge
| -rw-r--r-- | coreutils/dd.c | 16 | ||||
| -rw-r--r-- | coreutils/du.c | 4 | ||||
| -rw-r--r-- | coreutils/stty.c | 18 | ||||
| -rw-r--r-- | docs/posix_conformance.txt | 1 | ||||
| -rw-r--r-- | findutils/xargs.c | 14 | ||||
| -rw-r--r-- | libbb/inode_hash.c | 2 | ||||
| -rw-r--r-- | networking/ntpd.c | 9 | ||||
| -rw-r--r-- | networking/udhcp/d6_dhcpc.c | 8 | ||||
| -rw-r--r-- | networking/udhcp/dhcpc.c | 14 | ||||
| -rw-r--r-- | procps/top.c | 5 | ||||
| -rw-r--r-- | scripts/echo.c | 1 | ||||
| -rw-r--r-- | shell/ash.c | 14 |
12 files changed, 55 insertions, 51 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 | ||
| 153 | static void dd_output_status(int UNUSED_PARAM cur_signal) | 155 | static 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 | ||
diff --git a/docs/posix_conformance.txt b/docs/posix_conformance.txt index 0e6f4a317..f6e8858cc 100644 --- a/docs/posix_conformance.txt +++ b/docs/posix_conformance.txt | |||
| @@ -183,6 +183,7 @@ dd compatibility options: | |||
| 183 | iflag=skip_bytes| yes | | | 183 | iflag=skip_bytes| yes | | |
| 184 | iflag=fullblock | yes | | | 184 | iflag=fullblock | yes | | |
| 185 | oflag=seek_bytes| yes | | | 185 | oflag=seek_bytes| yes | | |
| 186 | oflag=append | yes | | | ||
| 186 | 187 | ||
| 187 | df POSIX options | 188 | df POSIX options |
| 188 | option | exists | compliant | remarks | 189 | option | exists | compliant | remarks |
diff --git a/findutils/xargs.c b/findutils/xargs.c index d014669bd..8331931bc 100644 --- a/findutils/xargs.c +++ b/findutils/xargs.c | |||
| @@ -602,23 +602,23 @@ static int xargs_ask_confirmation(void) | |||
| 602 | //usage: "[OPTIONS] [PROG ARGS]" | 602 | //usage: "[OPTIONS] [PROG ARGS]" |
| 603 | //usage:#define xargs_full_usage "\n\n" | 603 | //usage:#define xargs_full_usage "\n\n" |
| 604 | //usage: "Run PROG on every item given by stdin\n" | 604 | //usage: "Run PROG on every item given by stdin\n" |
| 605 | //usage: IF_FEATURE_XARGS_SUPPORT_CONFIRMATION( | ||
| 606 | //usage: "\n -p Ask user whether to run each command" | ||
| 607 | //usage: ) | ||
| 608 | //usage: "\n -r Don't run command if input is empty" | ||
| 609 | //usage: IF_FEATURE_XARGS_SUPPORT_ZERO_TERM( | 605 | //usage: IF_FEATURE_XARGS_SUPPORT_ZERO_TERM( |
| 610 | //usage: "\n -0 Input is separated by NULs" | 606 | //usage: "\n -0 Input is separated by NULs" |
| 611 | //usage: ) | 607 | //usage: ) |
| 612 | //usage: IF_FEATURE_XARGS_SUPPORT_ARGS_FILE( | 608 | //usage: IF_FEATURE_XARGS_SUPPORT_ARGS_FILE( |
| 613 | //usage: "\n -a FILE Read from FILE instead of stdin" | 609 | //usage: "\n -a FILE Read from FILE instead of stdin" |
| 614 | //usage: ) | 610 | //usage: ) |
| 611 | //usage: "\n -r Don't run command if input is empty" | ||
| 615 | //usage: "\n -t Print the command on stderr before execution" | 612 | //usage: "\n -t Print the command on stderr before execution" |
| 616 | //usage: "\n -e[STR] STR stops input processing" | 613 | //usage: IF_FEATURE_XARGS_SUPPORT_CONFIRMATION( |
| 617 | //usage: "\n -n N Pass no more than N args to PROG" | 614 | //usage: "\n -p Ask user whether to run each command" |
| 618 | //usage: "\n -s N Pass command line of no more than N bytes" | 615 | //usage: ) |
| 616 | //usage: "\n -E STR,-e[STR] STR stops input processing" | ||
| 619 | //usage: IF_FEATURE_XARGS_SUPPORT_REPL_STR( | 617 | //usage: IF_FEATURE_XARGS_SUPPORT_REPL_STR( |
| 620 | //usage: "\n -I STR Replace STR within PROG ARGS with input line" | 618 | //usage: "\n -I STR Replace STR within PROG ARGS with input line" |
| 621 | //usage: ) | 619 | //usage: ) |
| 620 | //usage: "\n -n N Pass no more than N args to PROG" | ||
| 621 | //usage: "\n -s N Pass command line of no more than N bytes" | ||
| 622 | //usage: IF_FEATURE_XARGS_SUPPORT_PARALLEL( | 622 | //usage: IF_FEATURE_XARGS_SUPPORT_PARALLEL( |
| 623 | //usage: "\n -P N Run up to N PROGs in parallel" | 623 | //usage: "\n -P N Run up to N PROGs in parallel" |
| 624 | //usage: ) | 624 | //usage: ) |
diff --git a/libbb/inode_hash.c b/libbb/inode_hash.c index 37fed9c82..f2cc417bc 100644 --- a/libbb/inode_hash.c +++ b/libbb/inode_hash.c | |||
| @@ -82,7 +82,7 @@ void FAST_FUNC add_to_ino_dev_hashtable(const struct stat *statbuf, const char * | |||
| 82 | ino_dev_hashtable[i] = bucket; | 82 | ino_dev_hashtable[i] = bucket; |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | #if ENABLE_DU || ENABLE_FEATURE_CLEAN_UP | 85 | #if ENABLE_FEATURE_CLEAN_UP |
| 86 | /* Clear statbuf hash table */ | 86 | /* Clear statbuf hash table */ |
| 87 | void FAST_FUNC reset_ino_dev_hashtable(void) | 87 | void FAST_FUNC reset_ino_dev_hashtable(void) |
| 88 | { | 88 | { |
diff --git a/networking/ntpd.c b/networking/ntpd.c index 855815ece..0f474bc09 100644 --- a/networking/ntpd.c +++ b/networking/ntpd.c | |||
| @@ -177,12 +177,11 @@ | |||
| 177 | */ | 177 | */ |
| 178 | #define STEP_THRESHOLD 1 | 178 | #define STEP_THRESHOLD 1 |
| 179 | /* Slew threshold (sec): adjtimex() won't accept offsets larger than this. | 179 | /* Slew threshold (sec): adjtimex() won't accept offsets larger than this. |
| 180 | * Using exact power of 2 (1/8) results in smaller code | 180 | * Using exact power of 2 (1/8, 1/2 etc) results in smaller code |
| 181 | */ | 181 | */ |
| 182 | #define SLEW_THRESHOLD 0.125 | 182 | #define SLEW_THRESHOLD 0.5 |
| 183 | //^^^^^^^^^^^^^^^^^^^^^^^^^^ TODO: man adjtimex about tmx.offset: | 183 | // ^^^^ used to be 0.125. |
| 184 | // "Since Linux 2.6.26, the supplied value is clamped to the range (-0.5s, +0.5s)" | 184 | // Since Linux 2.6.26 (circa 2006), kernel accepts (-0.5s, +0.5s) range |
| 185 | // - can use this larger value instead? | ||
| 186 | 185 | ||
| 187 | /* Stepout threshold (sec). std ntpd uses 900 (11 mins (!)) */ | 186 | /* Stepout threshold (sec). std ntpd uses 900 (11 mins (!)) */ |
| 188 | //UNUSED: #define WATCH_THRESHOLD 128 | 187 | //UNUSED: #define WATCH_THRESHOLD 128 |
diff --git a/networking/udhcp/d6_dhcpc.c b/networking/udhcp/d6_dhcpc.c index 38c91cbb4..8a4a4b7a5 100644 --- a/networking/udhcp/d6_dhcpc.c +++ b/networking/udhcp/d6_dhcpc.c | |||
| @@ -1370,7 +1370,13 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv) | |||
| 1370 | bb_error_msg("no lease, forking to background"); | 1370 | bb_error_msg("no lease, forking to background"); |
| 1371 | client_background(); | 1371 | client_background(); |
| 1372 | /* do not background again! */ | 1372 | /* do not background again! */ |
| 1373 | opt = ((opt & ~OPT_b) | OPT_f); | 1373 | opt = ((opt & ~(OPT_b|OPT_n)) | OPT_f); |
| 1374 | /* ^^^ also disables -n (-b takes priority over -n): | ||
| 1375 | * ifup's default udhcpc options are -R -n, | ||
| 1376 | * and users want to be able to add -b | ||
| 1377 | * (in a config file) to make it background | ||
| 1378 | * _and not exit_. | ||
| 1379 | */ | ||
| 1374 | } else | 1380 | } else |
| 1375 | #endif | 1381 | #endif |
| 1376 | if (opt & OPT_n) { /* abort if no lease */ | 1382 | if (opt & OPT_n) { /* abort if no lease */ |
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index dcec8cdfd..e2fb18aba 100644 --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c | |||
| @@ -1209,13 +1209,13 @@ static void client_background(void) | |||
| 1209 | //usage: "\n -t N Send up to N discover packets (default 3)" | 1209 | //usage: "\n -t N Send up to N discover packets (default 3)" |
| 1210 | //usage: "\n -T SEC Pause between packets (default 3)" | 1210 | //usage: "\n -T SEC Pause between packets (default 3)" |
| 1211 | //usage: "\n -A SEC Wait if lease is not obtained (default 20)" | 1211 | //usage: "\n -A SEC Wait if lease is not obtained (default 20)" |
| 1212 | //usage: USE_FOR_MMU( | ||
| 1213 | //usage: "\n -b Background if lease is not obtained" | ||
| 1214 | //usage: ) | ||
| 1212 | //usage: "\n -n Exit if lease is not obtained" | 1215 | //usage: "\n -n Exit if lease is not obtained" |
| 1213 | //usage: "\n -q Exit after obtaining lease" | 1216 | //usage: "\n -q Exit after obtaining lease" |
| 1214 | //usage: "\n -R Release IP on exit" | 1217 | //usage: "\n -R Release IP on exit" |
| 1215 | //usage: "\n -f Run in foreground" | 1218 | //usage: "\n -f Run in foreground" |
| 1216 | //usage: USE_FOR_MMU( | ||
| 1217 | //usage: "\n -b Background if lease is not obtained" | ||
| 1218 | //usage: ) | ||
| 1219 | //usage: "\n -S Log to syslog too" | 1219 | //usage: "\n -S Log to syslog too" |
| 1220 | //usage: IF_FEATURE_UDHCPC_ARPING( | 1220 | //usage: IF_FEATURE_UDHCPC_ARPING( |
| 1221 | //usage: "\n -a[MSEC] Validate offered address with ARP ping" | 1221 | //usage: "\n -a[MSEC] Validate offered address with ARP ping" |
| @@ -1484,7 +1484,13 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) | |||
| 1484 | bb_error_msg("no lease, forking to background"); | 1484 | bb_error_msg("no lease, forking to background"); |
| 1485 | client_background(); | 1485 | client_background(); |
| 1486 | /* do not background again! */ | 1486 | /* do not background again! */ |
| 1487 | opt = ((opt & ~OPT_b) | OPT_f); | 1487 | opt = ((opt & ~(OPT_b|OPT_n)) | OPT_f); |
| 1488 | /* ^^^ also disables -n (-b takes priority over -n): | ||
| 1489 | * ifup's default udhcpc options are -R -n, | ||
| 1490 | * and users want to be able to add -b | ||
| 1491 | * (in a config file) to make it background | ||
| 1492 | * _and not exit_. | ||
| 1493 | */ | ||
| 1488 | } else | 1494 | } else |
| 1489 | #endif | 1495 | #endif |
| 1490 | if (opt & OPT_n) { /* abort if no lease */ | 1496 | if (opt & OPT_n) { /* abort if no lease */ |
diff --git a/procps/top.c b/procps/top.c index 3db077060..625409755 100644 --- a/procps/top.c +++ b/procps/top.c | |||
| @@ -1043,7 +1043,7 @@ static unsigned handle_input(unsigned scan_mask, duration_t interval) | |||
| 1043 | //usage:# define IF_SHOW_THREADS_OR_TOP_SMP(...) | 1043 | //usage:# define IF_SHOW_THREADS_OR_TOP_SMP(...) |
| 1044 | //usage:#endif | 1044 | //usage:#endif |
| 1045 | //usage:#define top_trivial_usage | 1045 | //usage:#define top_trivial_usage |
| 1046 | //usage: "[-b] [-nCOUNT] [-dSECONDS]" IF_FEATURE_TOPMEM(" [-m]") | 1046 | //usage: "[-b"IF_FEATURE_TOPMEM("m")"] [-n COUNT] [-d SECONDS]" |
| 1047 | //usage:#define top_full_usage "\n\n" | 1047 | //usage:#define top_full_usage "\n\n" |
| 1048 | //usage: "Provide a view of process activity in real time." | 1048 | //usage: "Provide a view of process activity in real time." |
| 1049 | //usage: "\n""Read the status of all processes from /proc each SECONDS" | 1049 | //usage: "\n""Read the status of all processes from /proc each SECONDS" |
| @@ -1068,12 +1068,11 @@ static unsigned handle_input(unsigned scan_mask, duration_t interval) | |||
| 1068 | //usage: IF_FEATURE_TOP_SMP_CPU("1: toggle SMP") | 1068 | //usage: IF_FEATURE_TOP_SMP_CPU("1: toggle SMP") |
| 1069 | //usage: ) | 1069 | //usage: ) |
| 1070 | //usage: "\n"" Q,^C: exit" | 1070 | //usage: "\n"" Q,^C: exit" |
| 1071 | //usage: "\n" | ||
| 1072 | //usage: "\n""Options:" | 1071 | //usage: "\n""Options:" |
| 1073 | //usage: ) | 1072 | //usage: ) |
| 1074 | //usage: "\n"" -b Batch mode" | 1073 | //usage: "\n"" -b Batch mode" |
| 1075 | //usage: "\n"" -n N Exit after N iterations" | 1074 | //usage: "\n"" -n N Exit after N iterations" |
| 1076 | //usage: "\n"" -d N Delay between updates" | 1075 | //usage: "\n"" -d SEC Delay between updates" |
| 1077 | //usage: IF_FEATURE_TOPMEM( | 1076 | //usage: IF_FEATURE_TOPMEM( |
| 1078 | //usage: "\n"" -m Same as 's' key" | 1077 | //usage: "\n"" -m Same as 's' key" |
| 1079 | //usage: ) | 1078 | //usage: ) |
diff --git a/scripts/echo.c b/scripts/echo.c index 8c6b409d3..7474ccdd4 100644 --- a/scripts/echo.c +++ b/scripts/echo.c | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | #include <stdio.h> | 27 | #include <stdio.h> |
| 28 | #include <string.h> | 28 | #include <string.h> |
| 29 | #include <limits.h> | 29 | #include <limits.h> |
| 30 | #include <unistd.h> | ||
| 30 | 31 | ||
| 31 | #define WANT_HEX_ESCAPES 1 | 32 | #define WANT_HEX_ESCAPES 1 |
| 32 | 33 | ||
diff --git a/shell/ash.c b/shell/ash.c index 8ed0f19f3..8daf263dc 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
| @@ -9631,8 +9631,11 @@ evaltree(union node *n, int flags) | |||
| 9631 | { | 9631 | { |
| 9632 | int checkexit = 0; | 9632 | int checkexit = 0; |
| 9633 | int (*evalfn)(union node *, int); | 9633 | int (*evalfn)(union node *, int); |
| 9634 | struct stackmark smark; | ||
| 9634 | int status = 0; | 9635 | int status = 0; |
| 9635 | 9636 | ||
| 9637 | setstackmark(&smark); | ||
| 9638 | |||
| 9636 | if (n == NULL) { | 9639 | if (n == NULL) { |
| 9637 | TRACE(("evaltree(NULL) called\n")); | 9640 | TRACE(("evaltree(NULL) called\n")); |
| 9638 | goto out; | 9641 | goto out; |
| @@ -9746,6 +9749,7 @@ evaltree(union node *n, int flags) | |||
| 9746 | if (flags & EV_EXIT) | 9749 | if (flags & EV_EXIT) |
| 9747 | raise_exception(EXEXIT); | 9750 | raise_exception(EXEXIT); |
| 9748 | 9751 | ||
| 9752 | popstackmark(&smark); | ||
| 9749 | TRACE(("leaving evaltree (no interrupts)\n")); | 9753 | TRACE(("leaving evaltree (no interrupts)\n")); |
| 9750 | return exitstatus; | 9754 | return exitstatus; |
| 9751 | } | 9755 | } |
| @@ -9806,14 +9810,12 @@ evalfor(union node *n, int flags) | |||
| 9806 | struct arglist arglist; | 9810 | struct arglist arglist; |
| 9807 | union node *argp; | 9811 | union node *argp; |
| 9808 | struct strlist *sp; | 9812 | struct strlist *sp; |
| 9809 | struct stackmark smark; | ||
| 9810 | int status = 0; | 9813 | int status = 0; |
| 9811 | 9814 | ||
| 9812 | errlinno = lineno = n->ncase.linno; | 9815 | errlinno = lineno = n->ncase.linno; |
| 9813 | if (funcline) | 9816 | if (funcline) |
| 9814 | lineno -= funcline - 1; | 9817 | lineno -= funcline - 1; |
| 9815 | 9818 | ||
| 9816 | setstackmark(&smark); | ||
| 9817 | arglist.list = NULL; | 9819 | arglist.list = NULL; |
| 9818 | arglist.lastp = &arglist.list; | 9820 | arglist.lastp = &arglist.list; |
| 9819 | for (argp = n->nfor.args; argp; argp = argp->narg.next) { | 9821 | for (argp = n->nfor.args; argp; argp = argp->narg.next) { |
| @@ -9830,7 +9832,6 @@ evalfor(union node *n, int flags) | |||
| 9830 | break; | 9832 | break; |
| 9831 | } | 9833 | } |
| 9832 | loopnest--; | 9834 | loopnest--; |
| 9833 | popstackmark(&smark); | ||
| 9834 | 9835 | ||
| 9835 | return status; | 9836 | return status; |
| 9836 | } | 9837 | } |
| @@ -9841,14 +9842,12 @@ evalcase(union node *n, int flags) | |||
| 9841 | union node *cp; | 9842 | union node *cp; |
| 9842 | union node *patp; | 9843 | union node *patp; |
| 9843 | struct arglist arglist; | 9844 | struct arglist arglist; |
| 9844 | struct stackmark smark; | ||
| 9845 | int status = 0; | 9845 | int status = 0; |
| 9846 | 9846 | ||
| 9847 | errlinno = lineno = n->ncase.linno; | 9847 | errlinno = lineno = n->ncase.linno; |
| 9848 | if (funcline) | 9848 | if (funcline) |
| 9849 | lineno -= funcline - 1; | 9849 | lineno -= funcline - 1; |
| 9850 | 9850 | ||
| 9851 | setstackmark(&smark); | ||
| 9852 | arglist.list = NULL; | 9851 | arglist.list = NULL; |
| 9853 | arglist.lastp = &arglist.list; | 9852 | arglist.lastp = &arglist.list; |
| 9854 | expandarg(n->ncase.expr, &arglist, EXP_TILDE); | 9853 | expandarg(n->ncase.expr, &arglist, EXP_TILDE); |
| @@ -9867,8 +9866,6 @@ evalcase(union node *n, int flags) | |||
| 9867 | } | 9866 | } |
| 9868 | } | 9867 | } |
| 9869 | out: | 9868 | out: |
| 9870 | popstackmark(&smark); | ||
| 9871 | |||
| 9872 | return status; | 9869 | return status; |
| 9873 | } | 9870 | } |
| 9874 | 9871 | ||
| @@ -10590,7 +10587,6 @@ evalcommand(union node *cmd, int flags) | |||
| 10590 | struct localvar_list *localvar_stop; | 10587 | struct localvar_list *localvar_stop; |
| 10591 | struct parsefile *file_stop; | 10588 | struct parsefile *file_stop; |
| 10592 | struct redirtab *redir_stop; | 10589 | struct redirtab *redir_stop; |
| 10593 | struct stackmark smark; | ||
| 10594 | union node *argp; | 10590 | union node *argp; |
| 10595 | struct arglist arglist; | 10591 | struct arglist arglist; |
| 10596 | struct arglist varlist; | 10592 | struct arglist varlist; |
| @@ -10615,7 +10611,6 @@ evalcommand(union node *cmd, int flags) | |||
| 10615 | 10611 | ||
| 10616 | /* First expand the arguments. */ | 10612 | /* First expand the arguments. */ |
| 10617 | TRACE(("evalcommand(0x%lx, %d) called\n", (long)cmd, flags)); | 10613 | TRACE(("evalcommand(0x%lx, %d) called\n", (long)cmd, flags)); |
| 10618 | setstackmark(&smark); | ||
| 10619 | localvar_stop = pushlocalvars(); | 10614 | localvar_stop = pushlocalvars(); |
| 10620 | file_stop = g_parsefile; | 10615 | file_stop = g_parsefile; |
| 10621 | back_exitstatus = 0; | 10616 | back_exitstatus = 0; |
| @@ -10936,7 +10931,6 @@ evalcommand(union node *cmd, int flags) | |||
| 10936 | */ | 10931 | */ |
| 10937 | setvar0("_", lastarg); | 10932 | setvar0("_", lastarg); |
| 10938 | } | 10933 | } |
| 10939 | popstackmark(&smark); | ||
| 10940 | 10934 | ||
| 10941 | return status; | 10935 | return status; |
| 10942 | } | 10936 | } |
