From b6f29c2cd77cdc08ee91086fbbb3467f210e1a74 Mon Sep 17 00:00:00 2001 From: Mark Date: Sun, 5 Jul 2020 18:54:41 +0300 Subject: [PATCH] Treat req. pid == pid the same as req. pid == 0 in setpgrp --- sys/thread.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/thread.c b/sys/thread.c index 5816707..35d030d 100644 --- a/sys/thread.c +++ b/sys/thread.c @@ -657,6 +657,10 @@ int sys_setpgid(pid_t pid, pid_t pgrp) { return 0; } + if (pid == thr->pid) { + thr->pgid = pgrp; + return 0; + } // Find child with pid pid (guess only children can be setpgid'd) struct thread *chld = thread_child(thr, pid); if (!chld) {