From aa3cb2737764d69ac1845af85635185a1d30ee4d Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Thu, 6 Jul 1995 00:05:35 +0000 Subject: [PATCH] Don't use the TIOCLSET ioctl unless we're not using POSIX_TERMIOS. Don't just blindly set the file status flags to 0. Instead, do a fcntl(0, F_GETFL), and then reset the nonblocking flags. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6227 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/bsd/ChangeLog | 7 +++++++ src/appl/bsd/login.c | 15 +++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog index 148886cd0..f7321f555 100644 --- a/src/appl/bsd/ChangeLog +++ b/src/appl/bsd/ChangeLog @@ -1,3 +1,10 @@ +Wed Jul 5 20:03:37 1995 Theodore Y. Ts'o (tytso@dcl) + + * login.c (main): Don't use the TIOCLSET ioctl unless we're not + using POSIX_TERMIOS. Don't just blindly set the file + status flags to 0. Instead, do a fcntl(0, F_GETFL), and + then reset the nonblocking flags. + Sun Jul 2 19:48:27 1995 Sam Hartman * krcp.c: make errno extern diff --git a/src/appl/bsd/login.c b/src/appl/bsd/login.c index 958fb2342..d32f6fc94 100644 --- a/src/appl/bsd/login.c +++ b/src/appl/bsd/login.c @@ -399,17 +399,24 @@ int main(argc, argv) if (*argv) username = *argv; -#if !defined(_AIX) +#if !defined(POSIX_TERMIOS) && defined(TIOCLSET) ioctlval = 0; -#ifdef TIOCLSET - /* linux, sco don't have this line discipline interface */ + /* Only do this we we're not using POSIX_TERMIOS */ (void)ioctl(0, TIOCLSET, (char *)&ioctlval); #endif + #ifdef TIOCNXCL (void)ioctl(0, TIOCNXCL, (char *)0); #endif - (void)fcntl(0, F_SETFL, ioctlval); + + ioctlval = fcntl(0, F_GETFL); +#ifdef O_NONBLOCK + ioctlval &= ~O_NONBLOCK; +#endif +#ifdef O_NDELAY + ioctlval &= ~O_NDELAY; #endif + (void)fcntl(0, F_SETFL, ioctlval); #ifdef POSIX_TERMIOS (void)tcgetattr(0, &tc); -- 2.26.2