diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-07-29 03:08:05 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-07-29 03:08:05 +0000 |
commit | 64578c0589a3a741f81fb55c16eeb882128da00b (patch) | |
tree | 8b650156e44e4d39af8625185d857a88789b8074 /source3/lib/getsmbpass.c | |
parent | c48b3fce6be6d5d952cbcda0ddae223dda5a576f (diff) | |
download | samba-64578c0589a3a741f81fb55c16eeb882128da00b.tar.gz samba-64578c0589a3a741f81fb55c16eeb882128da00b.tar.bz2 samba-64578c0589a3a741f81fb55c16eeb882128da00b.zip |
merge from the autoconf2 branch to the main branch
(This used to be commit 3bda7ac417107a7b01d91805ca71c4330657ed21)
Diffstat (limited to 'source3/lib/getsmbpass.c')
-rw-r--r-- | source3/lib/getsmbpass.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/source3/lib/getsmbpass.c b/source3/lib/getsmbpass.c index 68754f0848..7e544fa8d0 100644 --- a/source3/lib/getsmbpass.c +++ b/source3/lib/getsmbpass.c @@ -40,20 +40,19 @@ static struct termio t; #define TCSANOW 0 #endif - int tcgetattr(int fd, struct termio *t) +static int tcgetattr(int fd, struct termio *t) { return ioctl(fd, TCGETA, t); } - int tcsetattr(int fd, int flags, struct termio *t) +static int tcsetattr(int fd, int flags, struct termio *t) { if(flags & TCSAFLUSH) ioctl(fd, TCFLSH, TCIOFLUSH); return ioctl(fd, TCSETS, t); } -#else /* SYSV_TERMIO */ -#ifdef BSD_TERMIO +#elif !defined(TCSAFLUSH) /* BSD TERMIO HANDLING */ @@ -63,33 +62,25 @@ static struct sgttyb t; #define TURN_ECHO_OFF(t) ((t).sg_flags &= ~ECHO) #define TURN_ECHO_ON(t) ((t).sg_flags |= ECHO) -#ifndef TCSAFLUSH #define TCSAFLUSH 1 -#endif - -#ifndef TCSANOW #define TCSANOW 0 -#endif - int tcgetattr(int fd, struct sgttyb *t) +static int tcgetattr(int fd, struct sgttyb *t) { return ioctl(fd, TIOCGETP, (char *)t); } - int tcsetattr(int fd, int flags, struct sgttyb *t) +static int tcsetattr(int fd, int flags, struct sgttyb *t) { return ioctl(fd, TIOCSETP, (char *)t); } -#else /* BSD_TERMIO */ - -/* POSIX TERMIO HANDLING */ +#else /* POSIX TERMIO HANDLING */ #define ECHO_IS_ON(t) ((t).c_lflag & ECHO) #define TURN_ECHO_OFF(t) ((t).c_lflag &= ~ECHO) #define TURN_ECHO_ON(t) ((t).c_lflag |= ECHO) static struct termios t; -#endif /* BSD_TERMIO */ #endif /* SYSV_TERMIO */ char *getsmbpass(char *prompt) @@ -101,7 +92,7 @@ char *getsmbpass(char *prompt) size_t nread; /* Catch problematic signals */ - signal(SIGINT, SIGNAL_CAST SIG_IGN); + CatchSignal(SIGINT, SIGNAL_CAST SIG_IGN); /* Try to write to and read from the terminal if we can. If we can't open the terminal, use stderr and stdin. */ @@ -153,7 +144,7 @@ char *getsmbpass(char *prompt) fclose (in); /* Catch problematic signals */ - signal(SIGINT, SIGNAL_CAST SIG_DFL); + CatchSignal(SIGINT, SIGNAL_CAST SIG_DFL); printf("\n"); return buf; |