-/* Copyright (C) 1992-1999,2001,2003,2004,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2019 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#include <stdio.h>
#include <stdio_ext.h>
#include <wchar.h>
#define flockfile(s) _IO_flockfile (s)
#define funlockfile(s) _IO_funlockfile (s)
-#include <bits/libc-lock.h>
+#include <libc-lock.h>
/* It is desirable to use this bit on systems that have it.
The only bit of terminal state we want to twiddle is echoing, which is
}
char *
-getpass (prompt)
- const char *prompt;
+getpass (const char *prompt)
{
FILE *in, *out;
struct termios s, t;
/* Try to write to and read from the terminal if we can.
If we can't open the terminal, use stderr and stdin. */
- in = fopen ("/dev/tty", "w+c");
+ in = fopen ("/dev/tty", "w+ce");
if (in == NULL)
{
in = stdin;
/* Write the prompt. */
__fxprintf (out, "%s", prompt);
- fflush_unlocked (out);
+ __fflush_unlocked (out);
/* Read the password. */
nread = __getline (&buf, &bufsize, in);