From: Theodore Tso Date: Fri, 11 Nov 1994 05:53:38 +0000 (+0000) Subject: Defining setpgrp(a,b) to setpgrp() if SETPGRP_TWOARG is not set can X-Git-Tag: krb5-1.0-beta5~995 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ee7566b527fe1b7e211145cb2bf4f02386e565ad;p=krb5.git Defining setpgrp(a,b) to setpgrp() if SETPGRP_TWOARG is not set can cause infinite macro recursion on some C preprocessors. Fix by putting the #ifdef for SETPGRP_TWOARG where setpgrp is actually called, instead of trying to redefine setpgrp(). git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4653 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog index 667b5b43c..281492994 100644 --- a/src/appl/bsd/ChangeLog +++ b/src/appl/bsd/ChangeLog @@ -1,3 +1,11 @@ +Tue Nov 8 23:52:58 1994 Theodore Y. Ts'o (tytso@dcl) + + * krshd.c (setpgrp): Defining setpgrp(a,b) to setpgrp() if + SETPGRP_TWOARG is not set can cause infinite macro + recursion on some C preprocessors. Fix by putting the + #ifdef for SETPGRP_TWOARG where setpgrp is actually + called, instead of trying to redefine setpgrp(). + Mon Nov 7 21:22:00 1994 Theodore Y. Ts'o (tytso@dcl) * configure.in: Add check for stdlib.h diff --git a/src/appl/bsd/configure.in b/src/appl/bsd/configure.in index 888b847c9..22be5c85d 100644 --- a/src/appl/bsd/configure.in +++ b/src/appl/bsd/configure.in @@ -34,7 +34,7 @@ AC_FUNC_CHECK(setreuid,AC_DEFINE(HAVE_SETREUID)) AC_FUNC_CHECK(setresuid,AC_DEFINE(HAVE_SETRESUID)) AC_FUNC_CHECK(waitpid,AC_DEFINE(HAVE_WAITPID)) AC_FUNC_CHECK(setsid,AC_DEFINE(HAVE_SETSID)) -AC_HAVE_HEADERS(sys/filio.h sys/sockio.h unistd.h stdlib.h sys/label.h ttyent.h lastlog.h sys/select.h sys/ptyvar.h) +AC_HAVE_HEADERS(sys/filio.h sys/sockio.h unistd.h stdlib.h sys/label.h sys/tty.h ttyent.h lastlog.h sys/select.h sys/ptyvar.h) AC_COMPILE_CHECK([use streams interface], [#include #include diff --git a/src/appl/bsd/krshd.c b/src/appl/bsd/krshd.c index a10782b95..159fe6ecf 100644 --- a/src/appl/bsd/krshd.c +++ b/src/appl/bsd/krshd.c @@ -173,10 +173,6 @@ char copyright[] = #include "loginpaths.h" -#ifndef SETPGRP_TWOARG -#define setpgrp(a,b) setpgrp() -#endif - #ifndef HAVE_KILLPG #define killpg(pid, sig) kill(-(pid), (sig)) #endif @@ -1112,7 +1108,11 @@ doit(f, fromp) #endif exit(0); } +#ifdef SETPGRP_TWOARG setpgrp(0, getpid()); +#else + setpgrp(); +#endif (void) close(s); (void) close(pv[0]); dup2(pv[1], 2); (void) close(pv[1]);