X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/7b00c0c43f52e9d27168e67a26aac19065cdb40c..ad3c9f2af814c84582fdd1649e49ec4f68572c5a:/compat-43/FreeBSD/setpgrp.c diff --git a/compat-43/FreeBSD/setpgrp.c b/compat-43/FreeBSD/setpgrp.c index 011f7bc..ebed79a 100644 --- a/compat-43/FreeBSD/setpgrp.c +++ b/compat-43/FreeBSD/setpgrp.c @@ -36,8 +36,13 @@ __FBSDID("$FreeBSD: src/lib/libc/compat-43/setpgrp.c,v 1.5 2007/01/09 00:27:49 i #include #include -int -setpgrp(pid_t pid, pid_t pgid) +/* UNIX03 only */ +pid_t +setpgrp(void) { - return(setpgid(pid, pgid)); + pid_t pgid = getpgrp(); + pid_t pid = getpid(); + if (pgid != pid) + setpgid(pid, pid); + return pid; }