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
+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
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 <sys/tty.h>
#include <sys/ttold.h>
#include "loginpaths.h"
-#ifndef SETPGRP_TWOARG
-#define setpgrp(a,b) setpgrp()
-#endif
-
#ifndef HAVE_KILLPG
#define killpg(pid, sig) kill(-(pid), (sig))
#endif
#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]);