From af400955f586d8af5fbee315c23a200da8bf14c9 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Thu, 29 Jun 2000 00:21:47 +0000 Subject: [PATCH] * getpty.c (pty_getpty): More conditionalizing variable defintion based on OS features. * cleanup.c (pty_cleanup): Add parenthesis about assignment in conditional (gcc suggestion). * pty-int.h: Include pty.h if it exists (for openpty prototype under Linux). * configure.in: Check for pty.h git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12451 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/pty/ChangeLog | 13 +++++++++++++ src/util/pty/cleanup.c | 2 +- src/util/pty/configure.in | 2 +- src/util/pty/getpty.c | 2 +- src/util/pty/pty-int.h | 3 +++ 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/util/pty/ChangeLog b/src/util/pty/ChangeLog index df5ef643c..67af4e7fb 100644 --- a/src/util/pty/ChangeLog +++ b/src/util/pty/ChangeLog @@ -1,3 +1,16 @@ +2000-06-28 Ezra Peisach + + * getpty.c (pty_getpty): More conditionalizing variable defintion + based on OS features. + + * cleanup.c (pty_cleanup): Add parenthesis about assignment in + conditional (gcc suggestion). + + * pty-int.h: Include pty.h if it exists (for openpty prototype + under Linux). + + * configure.in: Check for pty.h + 2000-06-26 Ezra Peisach * libpty.h: If SOCK_DGRAM is not defined, provide a definition for diff --git a/src/util/pty/cleanup.c b/src/util/pty/cleanup.c index cf0b451f7..32384108b 100644 --- a/src/util/pty/cleanup.c +++ b/src/util/pty/cleanup.c @@ -79,7 +79,7 @@ long pty_cleanup (slave, pid, update_utmp) return errno; case 0: ptyint_void_association(); - if ( retval = ( pty_open_ctty( slave, &fd ))) + if ((retval = pty_open_ctty(slave, &fd))) exit(retval); ptyint_vhangup(); exit(0); diff --git a/src/util/pty/configure.in b/src/util/pty/configure.in index 58ceb8369..1bf4decb4 100644 --- a/src/util/pty/configure.in +++ b/src/util/pty/configure.in @@ -53,7 +53,7 @@ AC_TYPE_MODE_T AC_CHECK_TYPE(time_t, long) AC_FUNC_CHECK(strsave,AC_DEFINE(HAS_STRSAVE)) AC_HAVE_FUNCS(getutent setreuid gettosbyname setsid ttyname line_push ptsname grantpt openpty logwtmp getutmpx) -AC_CHECK_HEADERS(unistd.h stdlib.h string.h utmpx.h utmp.h sys/filio.h sys/sockio.h sys/label.h sys/tty.h ttyent.h lastlog.h sys/select.h sys/ptyvar.h) +AC_CHECK_HEADERS(unistd.h stdlib.h string.h pty.h utmpx.h utmp.h sys/filio.h sys/sockio.h sys/label.h sys/tty.h ttyent.h lastlog.h sys/select.h sys/ptyvar.h) AC_CHECK_HEADERS(sys/wait.h) AC_CHECK_FUNCS(waitpid updwtmpx) DECLARE_SYS_ERRLIST diff --git a/src/util/pty/getpty.c b/src/util/pty/getpty.c index 7d8614038..f02b87ee8 100644 --- a/src/util/pty/getpty.c +++ b/src/util/pty/getpty.c @@ -28,7 +28,7 @@ long pty_getpty (fd, slave, slavelength) int slavelength; int *fd; char *slave; { -#if !defined(HAVE__GETPTY) +#if !defined(HAVE__GETPTY) && !defined(HAVE_OPENPTY) char *cp; char *p; int i,ptynum; diff --git a/src/util/pty/pty-int.h b/src/util/pty/pty-int.h index 2c47780fa..f2ede6e36 100644 --- a/src/util/pty/pty-int.h +++ b/src/util/pty/pty-int.h @@ -21,6 +21,9 @@ #include +#ifdef HAVE_PTY_H +#include +#endif #include #include #include -- 2.26.2