summaryrefslogtreecommitdiffstats
path: root/src/appl
diff options
context:
space:
mode:
authorTheodore Tso <tytso@mit.edu>1994-11-11 05:53:38 +0000
committerTheodore Tso <tytso@mit.edu>1994-11-11 05:53:38 +0000
commitee7566b527fe1b7e211145cb2bf4f02386e565ad (patch)
tree32adf6f83bf85a52bd5d16e4e2c05477ac8beb3b /src/appl
parent03d69d4ee58f5910315eeb6a062751f399c6ed98 (diff)
downloadkrb5-ee7566b527fe1b7e211145cb2bf4f02386e565ad.tar.gz
krb5-ee7566b527fe1b7e211145cb2bf4f02386e565ad.tar.xz
krb5-ee7566b527fe1b7e211145cb2bf4f02386e565ad.zip
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
Diffstat (limited to 'src/appl')
-rw-r--r--src/appl/bsd/ChangeLog8
-rw-r--r--src/appl/bsd/configure.in2
-rw-r--r--src/appl/bsd/krshd.c8
3 files changed, 13 insertions, 5 deletions
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 <sys/tty.h>
#include <sys/ttold.h>
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]);