]> andersk Git - openssh.git/commitdiff
- (dtucker) [configure.ac] Move openpty/ctty test outside of case statement
authordtucker <dtucker>
Thu, 21 Aug 2003 07:58:29 +0000 (07:58 +0000)
committerdtucker <dtucker>
Thu, 21 Aug 2003 07:58:29 +0000 (07:58 +0000)
   and after normal openpty test.

ChangeLog
configure.ac

index 1923446fbedf48a65892576caa103729c9c6cfbe..0e39d8522b07d0855cd3a95e446e7d4655c69d12 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,8 @@
  - (dtucker) [defines.h] Put CMSG_DATA, CMSG_FIRSTHDR with other CMSG* macros,
    change CMSG_DATA to use __CMSG_ALIGN (and thus work properly), reformat for
    consistency.
+ - (dtucker) [configure.ac] Move openpty/ctty test outside of case statement
+   and after normal openpty test.
 
 20030813
  - (dtucker) [session.c] Remove #ifdef TIOCSBRK kludge.
index b37b5f68a6875355af643daf3c9b8ec8ae6e625a..e0f2a1cfc341686ea6215391e977bacb376fad25 100644 (file)
@@ -195,56 +195,11 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
 *-*-linux*)
        no_dev_ptmx=1
        check_for_libcrypt_later=1
+       check_for_openpty_ctty_bug=1
        AC_DEFINE(DONT_TRY_OTHER_AF)
        AC_DEFINE(PAM_TTY_KLUDGE)
        AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
        inet6_default_4in6=yes
-       # openpty can be in libutil, needed for controlling tty test
-       AC_SEARCH_LIBS(openpty, util)
-       # make sure that openpty does not reacquire controlling terminal
-       AC_MSG_CHECKING(if openpty correctly handles controlling tty)
-       AC_TRY_RUN(
-               [
-#include <stdio.h>
-#include <sys/fcntl.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-int
-main()
-{
-       pid_t pid;
-       int fd, ptyfd, ttyfd, status;
-
-       pid = fork();
-       if (pid < 0) {          /* failed */
-               exit(1);
-       } else if (pid > 0) {   /* parent */
-               waitpid(pid, &status, 0);
-               if (WIFEXITED(status)) 
-                       exit(WEXITSTATUS(status));
-               else
-                       exit(2);
-       } else {                /* child */
-               close(0); close(1); close(2);
-               setsid();
-               openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
-               fd = open("/dev/tty", O_RDWR | O_NOCTTY);
-               if (fd >= 0)
-                       exit(3);        /* Acquired ctty: broken */
-               else
-                       exit(0);        /* Did not acquire ctty: OK */
-       }
-}
-               ],
-               [
-                       AC_MSG_RESULT(yes)
-               ],
-               [
-                       AC_MSG_RESULT(no)
-                       AC_DEFINE(SSHD_ACQUIRES_CTTY)
-               ]
-       )
        case `uname -r` in
        1.*|2.0.*)
                AC_DEFINE(BROKEN_CMSG_TYPE)
@@ -805,6 +760,53 @@ unlink(template); exit(0);
 )
 fi
 
+dnl make sure that openpty does not reacquire controlling terminal
+if test ! -z "$check_for_openpty_ctty_bug"; then
+       AC_MSG_CHECKING(if openpty correctly handles controlling tty)
+       AC_TRY_RUN(
+               [
+#include <stdio.h>
+#include <sys/fcntl.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+int
+main()
+{
+       pid_t pid;
+       int fd, ptyfd, ttyfd, status;
+
+       pid = fork();
+       if (pid < 0) {          /* failed */
+               exit(1);
+       } else if (pid > 0) {   /* parent */
+               waitpid(pid, &status, 0);
+               if (WIFEXITED(status)) 
+                       exit(WEXITSTATUS(status));
+               else
+                       exit(2);
+       } else {                /* child */
+               close(0); close(1); close(2);
+               setsid();
+               openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
+               fd = open("/dev/tty", O_RDWR | O_NOCTTY);
+               if (fd >= 0)
+                       exit(3);        /* Acquired ctty: broken */
+               else
+                       exit(0);        /* Did not acquire ctty: OK */
+       }
+}
+               ],
+               [
+                       AC_MSG_RESULT(yes)
+               ],
+               [
+                       AC_MSG_RESULT(no)
+                       AC_DEFINE(SSHD_ACQUIRES_CTTY)
+               ]
+       )
+fi
+
 AC_FUNC_GETPGRP
 
 # Check for PAM libs
This page took 0.138349 seconds and 5 git commands to generate.