aboutsummaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2019-01-08 15:57:03 +0000
committerRon Yorston <rmy@pobox.com>2019-01-08 16:01:43 +0000
commit3476fb9f4c369b0f99bef7175aa4084ba771ebd7 (patch)
tree3c37c3dbf87c99a00f8540d4a55ba9cf2029bba1 /win32
parentbade8b3460ea3cf1182cd1bda9faf8b6ccee6a25 (diff)
downloadbusybox-w32-3476fb9f4c369b0f99bef7175aa4084ba771ebd7.tar.gz
busybox-w32-3476fb9f4c369b0f99bef7175aa4084ba771ebd7.tar.bz2
busybox-w32-3476fb9f4c369b0f99bef7175aa4084ba771ebd7.zip
ps: display interpreted script name in comm column
When an interpreted script is being run the comm column in ps should display the name of the script not the name of the interpreter. Use a fake applet pathname to indicate which argument contains the script. This also allows pidof to obtain the pid of a script.
Diffstat (limited to 'win32')
-rw-r--r--win32/process.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/win32/process.c b/win32/process.c
index 49dddf864..80f4550ad 100644
--- a/win32/process.c
+++ b/win32/process.c
@@ -289,7 +289,8 @@ mingw_spawn_interpreter(int mode, const char *prog, char *const *argv, char *con
289 } else 289 } else
290#if ENABLE_FEATURE_PREFER_APPLETS || ENABLE_FEATURE_SH_STANDALONE 290#if ENABLE_FEATURE_PREFER_APPLETS || ENABLE_FEATURE_SH_STANDALONE
291 if (find_applet_by_name(interp.name) >= 0) { 291 if (find_applet_by_name(interp.name) >= 0) {
292 new_argv[0] = interp.name; 292 /* the fake path indicates the index of the script */
293 new_argv[0] = fullpath = xasprintf("%d:/%s", nopts+1, interp.name);
293 ret = mingw_spawn_applet(mode, new_argv, envp); 294 ret = mingw_spawn_applet(mode, new_argv, envp);
294 } else 295 } else
295#endif 296#endif