diff options
author | Theodore Tso <tytso@mit.edu> | 1995-07-06 00:05:35 +0000 |
---|---|---|
committer | Theodore Tso <tytso@mit.edu> | 1995-07-06 00:05:35 +0000 |
commit | aa3cb2737764d69ac1845af85635185a1d30ee4d (patch) | |
tree | eb923f90784d94db5f5a6f757ba9c1951384d3f7 | |
parent | 9b7d8b5e0d83f6e64a1f5ae19f14217186e5a679 (diff) | |
download | krb5-aa3cb2737764d69ac1845af85635185a1d30ee4d.tar.gz krb5-aa3cb2737764d69ac1845af85635185a1d30ee4d.tar.xz krb5-aa3cb2737764d69ac1845af85635185a1d30ee4d.zip |
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
-rw-r--r-- | src/appl/bsd/ChangeLog | 7 | ||||
-rw-r--r-- | 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 148886cd09..f7321f5558 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 <hartmans@tertius.mit.edu> * krcp.c: make errno extern diff --git a/src/appl/bsd/login.c b/src/appl/bsd/login.c index 958fb23427..d32f6fc942 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); |