aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2018-04-05 20:41:06 +0100
committerRon Yorston <rmy@pobox.com>2018-04-05 20:41:06 +0100
commiteda6f28c793db7d5a61ec4d8d801dfcb6def17b7 (patch)
treef0b2edea7bc9b4c795956b4297baae186ab04a21
parentf7c592f6d832602a628008d598a3aa130d89de4d (diff)
downloadbusybox-w32-eda6f28c793db7d5a61ec4d8d801dfcb6def17b7.tar.gz
busybox-w32-eda6f28c793db7d5a61ec4d8d801dfcb6def17b7.tar.bz2
busybox-w32-eda6f28c793db7d5a61ec4d8d801dfcb6def17b7.zip
ps: indicate forkshell processes in listing
-rw-r--r--shell/ash.c7
-rw-r--r--win32/process.c2
2 files changed, 5 insertions, 4 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 6d24fb55a..ba05f073f 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -14725,11 +14725,12 @@ int ash_main(int argc UNUSED_PARAM, char **argv)
14725 hSIGINT = CreateEvent(NULL, TRUE, FALSE, NULL); 14725 hSIGINT = CreateEvent(NULL, TRUE, FALSE, NULL);
14726 SetConsoleCtrlHandler(ctrl_handler, TRUE); 14726 SetConsoleCtrlHandler(ctrl_handler, TRUE);
14727 14727
14728 if (argc == 3 && !strcmp(argv[1], "--forkshell")) { 14728 if (argc == 3 && !strcmp(argv[1], "--fs")) {
14729 strcpy(bb_applet_name, "[sh]");
14729 forkshell_init(argv[2]); 14730 forkshell_init(argv[2]);
14730 14731
14731 /* NOTREACHED */ 14732 /* NOTREACHED */
14732 bb_error_msg_and_die("subshell ended unexpectedly"); 14733 bb_error_msg_and_die("forkshell failed");
14733 } 14734 }
14734#endif 14735#endif
14735 login_sh = procargs(argv); 14736 login_sh = procargs(argv);
@@ -14983,7 +14984,7 @@ spawn_forkshell(struct job *jp, struct forkshell *fs, int mode)
14983{ 14984{
14984 struct forkshell *new; 14985 struct forkshell *new;
14985 char buf[32]; 14986 char buf[32];
14986 const char *argv[] = { "sh", "--forkshell", NULL, NULL }; 14987 const char *argv[] = { "sh", "--fs", NULL, NULL };
14987 intptr_t ret; 14988 intptr_t ret;
14988 14989
14989 new = forkshell_prepare(fs); 14990 new = forkshell_prepare(fs);
diff --git a/win32/process.c b/win32/process.c
index 3219fcad4..b9168ba1d 100644
--- a/win32/process.c
+++ b/win32/process.c
@@ -471,7 +471,7 @@ static char *get_applet_name(DWORD pid, char *exe)
471 471
472 /* check that the string really is an applet name */ 472 /* check that the string really is an applet name */
473 buffer[31] = '\0'; 473 buffer[31] = '\0';
474 if (find_applet_by_name(buffer) >= 0) { 474 if (find_applet_by_name(buffer) >= 0 || !strcmp(buffer, "[sh]")) {
475 name = auto_string(xstrdup(buffer)); 475 name = auto_string(xstrdup(buffer));
476 } 476 }
477 477