summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2013-02-15 11:41:35 +1100
committerDarren Tucker <dtucker@zip.com.au>2013-02-15 11:41:35 +1100
commit3c4a24c3e329ccca86629ed694b9756309b00113 (patch)
tree31d7a56074a06b4f25ab9514824806527313d5f1
parent4018dc04daa613d0e20df10947b85f154dc5765d (diff)
- (dtucker) [configure.ac openbsd-compat/bsd-misc.c openbsd-compat/bsd-misc.h]
Use getpgrp() if we don't have getpgid() (old BSDs, maybe others).
-rw-r--r--ChangeLog2
-rw-r--r--configure.ac6
-rw-r--r--openbsd-compat/bsd-misc.c13
-rw-r--r--openbsd-compat/bsd-misc.h6
4 files changed, 24 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 2a258466..b4abe75f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
20130215
- (djm) [contrib/suse/rc.sshd] Use SSHD_BIN consistently; bz#2056 from
Iain Morgan
+ - (dtucker) [configure.ac openbsd-compat/bsd-misc.c openbsd-compat/bsd-misc.h]
+ Use getpgrp() if we don't have getpgid() (old BSDs, maybe others).
- (djm) OpenBSD CVS Sync
- djm@cvs.openbsd.org 2013/02/14 21:35:59
[auth2-pubkey.c]
diff --git a/configure.ac b/configure.ac
index e96e81e6..def34fa0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-# $Id: configure.ac,v 1.503 2013/02/10 23:39:13 djm Exp $
+# $Id: configure.ac,v 1.504 2013/02/15 00:41:35 dtucker Exp $
#
# Copyright (c) 1999-2004 Damien Miller
#
@@ -15,7 +15,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org])
-AC_REVISION($Revision: 1.503 $)
+AC_REVISION($Revision: 1.504 $)
AC_CONFIG_SRCDIR([ssh.c])
AC_LANG([C])
@@ -1550,6 +1550,8 @@ AC_CHECK_FUNCS([ \
getopt \
getpeereid \
getpeerucred \
+ getpgid \
+ getpgrp \
_getpty \
getrlimit \
getttyent \
diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c
index 3ef373f5..0cff2e42 100644
--- a/openbsd-compat/bsd-misc.c
+++ b/openbsd-compat/bsd-misc.c
@@ -247,3 +247,16 @@ int isblank(int c)
return (c == ' ' || c == '\t');
}
#endif
+
+#ifndef HAVE_GETPGID
+pid_t
+getpgid(pid_t pid)
+{
+#ifdef HAVE_GETPGRP
+ if (pid == 0)
+ return getpgrp();
+#endif
+ errno = ESRCH;
+ return -1;
+}
+#endif
diff --git a/openbsd-compat/bsd-misc.h b/openbsd-compat/bsd-misc.h
index eac5217c..de836738 100644
--- a/openbsd-compat/bsd-misc.h
+++ b/openbsd-compat/bsd-misc.h
@@ -1,4 +1,4 @@
-/* $Id: bsd-misc.h,v 1.21 2012/07/03 22:50:10 dtucker Exp $ */
+/* $Id: bsd-misc.h,v 1.22 2013/02/15 00:41:36 dtucker Exp $ */
/*
* Copyright (c) 1999-2004 Damien Miller <djm@mindrot.org>
@@ -102,4 +102,8 @@ mysig_t mysignal(int sig, mysig_t act);
int isblank(int);
#endif
+#ifndef HAVE_GETPGID
+pid_t getpgid(pid_t);
+#endif
+
#endif /* _BSD_MISC_H */