version 1.13, 2007/10/17 15:40:54 |
version 1.14, 2008/01/21 19:44:29 |
|
|
#include "sudo.h" |
#include "sudo.h" |
|
|
#ifndef lint |
#ifndef lint |
__unused static const char rcsid[] = "$Sudo: tgetpass.c,v 1.111.2.5 2007/10/17 15:39:43 millert Exp $"; |
__unused static const char rcsid[] = "$Sudo: tgetpass.c,v 1.111.2.6 2008/01/16 18:03:24 millert Exp $"; |
#endif /* lint */ |
#endif /* lint */ |
|
|
#ifndef TCSASOFT |
#ifndef TCSASOFT |
|
|
# define tcsetattr(f, a, t) ioctl(f, a, t) |
# define tcsetattr(f, a, t) ioctl(f, a, t) |
# undef TCSAFLUSH |
# undef TCSAFLUSH |
# define TCSAFLUSH TCSETAF |
# define TCSAFLUSH TCSETAF |
# undef TCSANOW |
|
# define TCSANOW TCSETA |
|
# else |
# else |
# undef termios |
# undef termios |
# define termios sgttyb |
# define termios sgttyb |
|
|
# define tcsetattr(f, a, t) ioctl(f, a, t) |
# define tcsetattr(f, a, t) ioctl(f, a, t) |
# undef TCSAFLUSH |
# undef TCSAFLUSH |
# define TCSAFLUSH TIOCSETP |
# define TCSAFLUSH TIOCSETP |
# undef TCSANOW |
|
# define TCSANOW TIOCSETN |
|
# endif /* HAVE_TERMIO_H */ |
# endif /* HAVE_TERMIO_H */ |
#endif /* HAVE_TERMIOS_H */ |
#endif /* HAVE_TERMIOS_H */ |
|
|
|
|
|
|
/* Restore old tty settings and signals. */ |
/* Restore old tty settings and signals. */ |
if (memcmp(&term, &oterm, sizeof(term)) != 0) { |
if (memcmp(&term, &oterm, sizeof(term)) != 0) { |
while (tcsetattr(input, TCSANOW|TCSASOFT, &oterm) == -1 && |
while (tcsetattr(input, TCSAFLUSH|TCSASOFT, &oterm) == -1 && |
errno == EINTR) |
errno == EINTR) |
continue; |
continue; |
} |
} |