summaryrefslogtreecommitdiff
path: root/openbsd-compat/bsd-misc.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2013-02-15 14:55:38 +1100
committerDarren Tucker <dtucker@zip.com.au>2013-02-15 14:55:38 +1100
commit2991d288db4355a54f0860be184c31343cb2c139 (patch)
tree39fd4d86cc24c7d44592bcf1aababbaf22e48bd3 /openbsd-compat/bsd-misc.c
parentf32db83f41cc0c1355ae28fd9df464ea56562d2d (diff)
- (dtucker) [openbsd-compat/bsd-misc.c] Handle the case where setpgrp() takes
an argument. Pointed out by djm.
Diffstat (limited to 'openbsd-compat/bsd-misc.c')
-rw-r--r--openbsd-compat/bsd-misc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c
index ad524b8b..8dc7d02d 100644
--- a/openbsd-compat/bsd-misc.c
+++ b/openbsd-compat/bsd-misc.c
@@ -253,10 +253,13 @@ isblank(int c)
pid_t
getpgid(pid_t pid)
{
-#ifdef HAVE_GETPGRP
+#if defined(HAVE_GETPGRP) && !defined(GETPGRP_VOID)
+ return getpgrp(pid);
+#elif defined(HAVE_GETPGRP)
if (pid == 0)
return getpgrp();
#endif
+
errno = ESRCH;
return -1;
}