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 ad524b8b7..8dc7d02d1 100644
--- a/openbsd-compat/bsd-misc.c
+++ b/openbsd-compat/bsd-misc.c
@@ -253,10 +253,13 @@ isblank(int c)
253pid_t 253pid_t
254getpgid(pid_t pid) 254getpgid(pid_t pid)
255{ 255{
256#ifdef HAVE_GETPGRP 256#if defined(HAVE_GETPGRP) && !defined(GETPGRP_VOID)
257 return getpgrp(pid);
258#elif defined(HAVE_GETPGRP)
257 if (pid == 0) 259 if (pid == 0)
258 return getpgrp(); 260 return getpgrp();
259#endif 261#endif
262
260 errno = ESRCH; 263 errno = ESRCH;
261 return -1; 264 return -1;
262} 265}