diff options
Diffstat (limited to 'source3/lib/getsmbpass.c')
-rw-r--r-- | source3/lib/getsmbpass.c | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/source3/lib/getsmbpass.c b/source3/lib/getsmbpass.c index 07a7dbfd9b..0874529d32 100644 --- a/source3/lib/getsmbpass.c +++ b/source3/lib/getsmbpass.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. +/* Copyright (C) 1992-1998 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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, const 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,37 +62,28 @@ 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, const 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) +char *getsmbpass(char *prompt) { FILE *in, *out; int echo_off; @@ -102,7 +92,7 @@ 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. */ @@ -154,13 +144,13 @@ getsmbpass(char *prompt) fclose (in); /* Catch problematic signals */ - signal(SIGINT, SIGNAL_CAST SIG_DFL); + CatchSignal(SIGINT, SIGNAL_CAST SIG_DFL); printf("\n"); return buf; } #else - -void getsmbpasswd_dummy() {;} + void getsmbpasswd_dummy(void); + void getsmbpasswd_dummy(void) {;} #endif |