diff options
author | Ron Yorston <rmy@pobox.com> | 2023-04-17 07:32:52 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2023-04-17 07:32:52 +0100 |
commit | 8cdeb571cfbf3bb6edc44779e46537b072b8cd08 (patch) | |
tree | 9f3ad1d205418197bc53348b61f702602229a90d /libbb | |
parent | 41827dd448c001b52b4f0e591ea605cb5de1d230 (diff) | |
parent | d2b81b3dc2b31d32e1060d3ea8bd998d30a37d8a (diff) | |
download | busybox-w32-8cdeb571cfbf3bb6edc44779e46537b072b8cd08.tar.gz busybox-w32-8cdeb571cfbf3bb6edc44779e46537b072b8cd08.tar.bz2 busybox-w32-8cdeb571cfbf3bb6edc44779e46537b072b8cd08.zip |
Merge branch 'busybox' into merge
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/appletlib.c | 2 | ||||
-rw-r--r-- | libbb/duration.c | 16 | ||||
-rw-r--r-- | libbb/lineedit.c | 4 |
3 files changed, 10 insertions, 12 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c index dacfbdd22..379d6af2f 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c | |||
@@ -1094,7 +1094,7 @@ int busybox_main(int argc UNUSED_PARAM, char **argv) | |||
1094 | # endif | 1094 | # endif |
1095 | 1095 | ||
1096 | # if NUM_APPLETS > 0 | 1096 | # if NUM_APPLETS > 0 |
1097 | void FAST_FUNC show_usage_if_dash_dash_help(int applet_no, char **argv) | 1097 | void FAST_FUNC show_usage_if_dash_dash_help(int applet_no UNUSED_PARAM, char **argv) |
1098 | { | 1098 | { |
1099 | /* Special case. POSIX says "test --help" | 1099 | /* Special case. POSIX says "test --help" |
1100 | * should be no different from e.g. "test --foo". | 1100 | * should be no different from e.g. "test --foo". |
diff --git a/libbb/duration.c b/libbb/duration.c index 793d02f42..0024f1a66 100644 --- a/libbb/duration.c +++ b/libbb/duration.c | |||
@@ -76,16 +76,14 @@ void FAST_FUNC sleep_for_duration(duration_t duration) | |||
76 | ts.tv_sec = duration; | 76 | ts.tv_sec = duration; |
77 | ts.tv_nsec = (duration - ts.tv_sec) * 1000000000; | 77 | ts.tv_nsec = (duration - ts.tv_sec) * 1000000000; |
78 | } | 78 | } |
79 | /* NB: if ENABLE_ASH_SLEEP, we end up here if "sleep N" | 79 | /* NB: ENABLE_ASH_SLEEP requires that we do NOT loop on EINTR here: |
80 | * is run in ash. ^C will still work, because ash's signal handler | 80 | * otherwise, traps won't execute until we finish looping. |
81 | * does not return (it longjumps), the below loop | ||
82 | * will not continue looping. | ||
83 | * (This wouldn't work in hush) | ||
84 | */ | 81 | */ |
85 | do { | 82 | //do { |
86 | errno = 0; | 83 | // errno = 0; |
87 | nanosleep(&ts, &ts); | 84 | // nanosleep(&ts, &ts); |
88 | } while (errno == EINTR); | 85 | //} while (errno == EINTR); |
86 | nanosleep(&ts, &ts); | ||
89 | } | 87 | } |
90 | #else | 88 | #else |
91 | duration_t FAST_FUNC parse_duration_str(char *str) | 89 | duration_t FAST_FUNC parse_duration_str(char *str) |
diff --git a/libbb/lineedit.c b/libbb/lineedit.c index 45d4c33f5..3abc97503 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c | |||
@@ -254,7 +254,7 @@ static NOINLINE const char *get_homedir_or_NULL(void) | |||
254 | const char *home; | 254 | const char *home; |
255 | 255 | ||
256 | # if ENABLE_SHELL_ASH || ENABLE_SHELL_HUSH | 256 | # if ENABLE_SHELL_ASH || ENABLE_SHELL_HUSH |
257 | home = state->sh_get_var ? state->sh_get_var("HOME") : getenv("HOME"); | 257 | home = state && state->sh_get_var ? state->sh_get_var("HOME") : getenv("HOME"); |
258 | # else | 258 | # else |
259 | home = getenv("HOME"); | 259 | home = getenv("HOME"); |
260 | # endif | 260 | # endif |
@@ -2159,7 +2159,7 @@ static void parse_and_put_prompt(const char *prmt_ptr) | |||
2159 | if (!cwd_buf) { | 2159 | if (!cwd_buf) { |
2160 | const char *home; | 2160 | const char *home; |
2161 | # if EDITING_HAS_sh_get_var | 2161 | # if EDITING_HAS_sh_get_var |
2162 | cwd_buf = state->sh_get_var | 2162 | cwd_buf = state && state->sh_get_var |
2163 | ? xstrdup(state->sh_get_var("PWD")) | 2163 | ? xstrdup(state->sh_get_var("PWD")) |
2164 | : xrealloc_getcwd_or_warn(NULL); | 2164 | : xrealloc_getcwd_or_warn(NULL); |
2165 | # else | 2165 | # else |