From 47a84c03c3fb9a8cc7b564f724a1f1f7be95b84b Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sun, 18 Jan 2004 06:04:49 +0000 Subject: [PATCH] Use getpt() if available. --- v7/src/microcode/configure.ac | 4 ++-- v7/src/microcode/uxterm.c | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/v7/src/microcode/configure.ac b/v7/src/microcode/configure.ac index ab48247d7..028669e05 100644 --- a/v7/src/microcode/configure.ac +++ b/v7/src/microcode/configure.ac @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT([MIT/GNU Scheme], [14.14], [bug-mit-scheme@gnu.org], [mit-scheme]) -AC_REVISION([$Id: configure.ac,v 1.2 2004/01/16 20:36:29 cph Exp $]) +AC_REVISION([$Id: configure.ac,v 1.3 2004/01/18 06:04:46 cph Exp $]) AC_CONFIG_SRCDIR([boot.c]) AC_CONFIG_HEADERS([config.h]) AC_PROG_MAKE_SET @@ -493,7 +493,7 @@ AC_CHECK_FUNCS([ctermid]) AC_CHECK_FUNCS([dup2]) AC_CHECK_FUNCS([fcntl floor fpathconf frexp ftruncate]) AC_CHECK_FUNCS([getcwd gethostbyname gethostname getlogin getpagesize getpgrp]) -AC_CHECK_FUNCS([gettimeofday getwd grantpt]) +AC_CHECK_FUNCS([getpt gettimeofday getwd grantpt]) AC_CHECK_FUNCS([kill]) AC_CHECK_FUNCS([lockf]) AC_CHECK_FUNCS([memcpy mkdir mktime modf]) diff --git a/v7/src/microcode/uxterm.c b/v7/src/microcode/uxterm.c index 9539886c1..73f783709 100644 --- a/v7/src/microcode/uxterm.c +++ b/v7/src/microcode/uxterm.c @@ -1,8 +1,9 @@ /* -*-C-*- -$Id: uxterm.c,v 1.30 2003/02/14 18:28:24 cph Exp $ +$Id: uxterm.c,v 1.31 2004/01/18 06:04:49 cph Exp $ -Copyright (c) 1990-2000 Massachusetts Institute of Technology +Copyright 1991,1992,1993,1995,1997,2000 Massachusetts Institute of Technology +Copyright 2004 Massachusetts Institute of Technology This file is part of MIT/GNU Scheme. @@ -779,6 +780,10 @@ DEFUN (open_pty_master_bsd, (master_fd, master_fname), return (0); } +#ifndef O_NOCTTY +# define O_NOCTTY 0 +#endif + /* Open an available pty, putting channel in (*ptyv), and return the file name of the pty. Signal error if none available. */ @@ -792,7 +797,11 @@ DEFUN (OS_open_pty_master, (master_fd, master_fname), while (1) { static char slave_name [24]; - int fd = (UX_open ("/dev/ptmx", O_RDWR, 0)); +#ifdef HAVE_GETPT + int fd = (getpt ()); +#else + int fd = (UX_open ("/dev/ptmx", (O_RDWR | O_NOCTTY), 0)); +#endif if (fd < 0) { if (errno == EINTR) -- 2.25.1