about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorHan Pingtian <hanpt@linux.vnet.ibm.com>2021-05-15 14:23:28 -0700
committerBart Schaefer <schaefer@ipost.com>2021-05-15 14:23:28 -0700
commit8bdbc6149709e4c5e9abfe9a02cdc5101114901a (patch)
tree2d7619c0c71599087223b81215ce8fcd68515b96 /Src
parent4fa4dcad17f593a8def8799ad1d5258c328d9ead (diff)
downloadzsh-8bdbc6149709e4c5e9abfe9a02cdc5101114901a.tar.gz
zsh-8bdbc6149709e4c5e9abfe9a02cdc5101114901a.tar.xz
zsh-8bdbc6149709e4c5e9abfe9a02cdc5101114901a.zip
33465: use prctl() for "jobs -Z" where available
Bart apologizes for waiting 7 years to apply this change.
Diffstat (limited to 'Src')
-rw-r--r--Src/jobs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Src/jobs.c b/Src/jobs.c
index 0d4993554..f0b337110 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -2270,6 +2270,13 @@ bin_fg(char *name, char **argv, Options ops, int func)
 	memcpy(hackzero, *argv, len);
 	memset(hackzero + len, 0, hackspace - len);
 #endif
+
+#ifdef HAVE_PRCTL
+	/* try to change /proc/$$/comm which will *
+	 * be used when checking with "ps -e"  */
+#include <sys/prctl.h>
+	prctl(PR_SET_NAME, *argv);
+#endif
 	unqueue_signals();
 	return 0;
     }