aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2019-02-12 08:43:06 +0000
committerRon Yorston <rmy@pobox.com>2019-02-12 08:43:06 +0000
commit7a8bd5ae33d8c390763f0787afe6b8c495e2d978 (patch)
tree29b0abb320d73b37f4fa4d9b355b3b32db42e836 /libbb
parent0eda390d68c456975289471e68b615ae096ab33b (diff)
parentf81e0120f4478c58e126bcadb19b9954ed184e8f (diff)
downloadbusybox-w32-7a8bd5ae33d8c390763f0787afe6b8c495e2d978.tar.gz
busybox-w32-7a8bd5ae33d8c390763f0787afe6b8c495e2d978.tar.bz2
busybox-w32-7a8bd5ae33d8c390763f0787afe6b8c495e2d978.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'libbb')
-rw-r--r--libbb/capability.c2
-rw-r--r--libbb/lineedit.c9
-rw-r--r--libbb/vfork_daemon_rexec.c16
3 files changed, 14 insertions, 13 deletions
diff --git a/libbb/capability.c b/libbb/capability.c
index 6587dcbf7..d0ae78b91 100644
--- a/libbb/capability.c
+++ b/libbb/capability.c
@@ -67,7 +67,7 @@ unsigned FAST_FUNC cap_name_to_number(const char *cap)
67 goto found; 67 goto found;
68 } 68 }
69 for (i = 0; i < ARRAY_SIZE(capabilities); i++) { 69 for (i = 0; i < ARRAY_SIZE(capabilities); i++) {
70 if (strcasecmp(capabilities[i], cap) != 0) 70 if (strcasecmp(capabilities[i], cap) == 0)
71 goto found; 71 goto found;
72 } 72 }
73 bb_error_msg_and_die("unknown capability '%s'", cap); 73 bb_error_msg_and_die("unknown capability '%s'", cap);
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index 0b4e326d8..0ec9baa5f 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -2462,13 +2462,14 @@ int FAST_FUNC read_line_input(line_input_t *st, const char *prompt, char *comman
2462 timeout = st->timeout; 2462 timeout = st->timeout;
2463 } 2463 }
2464#if MAX_HISTORY > 0 2464#if MAX_HISTORY > 0
2465 if (state->flags & DO_HISTORY) {
2465# if ENABLE_FEATURE_EDITING_SAVEHISTORY 2466# if ENABLE_FEATURE_EDITING_SAVEHISTORY
2466 if (state->hist_file) 2467 if (state->hist_file)
2467 if (state->cnt_history == 0) 2468 if (state->cnt_history == 0)
2468 load_history(state); 2469 load_history(state);
2469# endif 2470# endif
2470 if (state->flags & DO_HISTORY)
2471 state->cur_history = state->cnt_history; 2471 state->cur_history = state->cnt_history;
2472 }
2472#endif 2473#endif
2473 2474
2474 /* prepare before init handlers */ 2475 /* prepare before init handlers */
diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c
index 569a6fc34..2d497d754 100644
--- a/libbb/vfork_daemon_rexec.c
+++ b/libbb/vfork_daemon_rexec.c
@@ -297,14 +297,14 @@ void FAST_FUNC bb_daemonize_or_rexec(int flags, char **argv)
297 dup2(fd, 0); 297 dup2(fd, 0);
298 dup2(fd, 1); 298 dup2(fd, 1);
299 dup2(fd, 2); 299 dup2(fd, 2);
300 if (flags & DAEMON_DOUBLE_FORK) { 300// if (flags & DAEMON_DOUBLE_FORK) {
301 /* On Linux, session leader can acquire ctty 301// /* On Linux, session leader can acquire ctty
302 * unknowingly, by opening a tty. 302// * unknowingly, by opening a tty.
303 * Prevent this: stop being a session leader. 303// * Prevent this: stop being a session leader.
304 */ 304// */
305 if (fork_or_rexec(argv)) 305// if (fork_or_rexec(argv))
306 _exit(EXIT_SUCCESS); /* parent */ 306// _exit(EXIT_SUCCESS); /* parent */
307 } 307// }
308 } 308 }
309 while (fd > 2) { 309 while (fd > 2) {
310 close(fd--); 310 close(fd--);