]> git.saurik.com Git - apple/libc.git/blob - compat-43/FreeBSD/setpgrp.c.patch
c728f033f75b36a82757bbc225e595fa4e50cd3f
[apple/libc.git] / compat-43 / FreeBSD / setpgrp.c.patch
1 --- setpgrp.c.orig 2006-09-17 12:11:20.000000000 -0700
2 +++ setpgrp.c 2006-09-24 16:13:25.000000000 -0700
3 @@ -40,8 +40,13 @@
4 #include <sys/types.h>
5 #include <unistd.h>
6
7 -int
8 -setpgrp(pid_t pid, pid_t pgid)
9 +/* UNIX03 only */
10 +pid_t
11 +setpgrp(void)
12 {
13 - return(setpgid(pid, pgid));
14 + pid_t pgid = getpgrp();
15 + pid_t pid = getpid();
16 + if (pgid != pid)
17 + setpgid(pid, pid);
18 + return pid;
19 }