- (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).
This commit is contained in:
Darren Tucker 2013-02-15 11:41:35 +11:00
parent 4018dc04da
commit 3c4a24c3e3
4 changed files with 24 additions and 3 deletions

View File

@ -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]

View File

@ -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 \

View File

@ -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

View File

@ -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 */