aboutsummaryrefslogtreecommitdiffstats
path: root/exec/exec1.c
diff options
context:
space:
mode:
Diffstat (limited to 'exec/exec1.c')
-rw-r--r--exec/exec1.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/exec/exec1.c b/exec/exec1.c
index 835bf8e72b9..d77ca8adf54 100644
--- a/exec/exec1.c
+++ b/exec/exec1.c
@@ -20,6 +20,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
20#include <config.h> 20#include <config.h>
21#include <unistd.h> 21#include <unistd.h>
22#include <stdlib.h> 22#include <stdlib.h>
23#include <stdio.h>
23#include <sys/wait.h> 24#include <sys/wait.h>
24 25
25#include "exec.h" 26#include "exec.h"
@@ -41,10 +42,15 @@ main (int argc, char **argv)
41 extern char **environ; 42 extern char **environ;
42 int wstatus; 43 int wstatus;
43 44
45 pid1 = getpid ();
44 pid = fork (); 46 pid = fork ();
45 47
46 if (!pid) 48 if (!pid)
47 { 49 {
50 /* Set the process group used to the parent. */
51 if (setpgid (0, pid1))
52 perror ("setpgid");
53
48 tracing_execve (argv[2], argv + 2, environ); 54 tracing_execve (argv[2], argv + 2, environ);
49 55
50 /* An error occured. Exit with failure. */ 56 /* An error occured. Exit with failure. */