mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-03-07 14:18:15 +08:00
ITS#6702 prompts should be on stderr
This commit is contained in:
parent
acedf4f194
commit
c7e19f9b62
@ -103,8 +103,8 @@ lutil_getpass( const char *prompt )
|
|||||||
#else
|
#else
|
||||||
fi = stdin;
|
fi = stdin;
|
||||||
#endif
|
#endif
|
||||||
fprintf(stdout, "%s", prompt);
|
fprintf(stderr, "%s", prompt);
|
||||||
fflush(stdout);
|
fflush(stderr);
|
||||||
i = 0;
|
i = 0;
|
||||||
while ( (c = getc(fi)) != EOF && c != '\n' && c != '\r' )
|
while ( (c = getc(fi)) != EOF && c != '\n' && c != '\r' )
|
||||||
if ( i < (sizeof(pbuf)-1) )
|
if ( i < (sizeof(pbuf)-1) )
|
||||||
@ -112,8 +112,8 @@ lutil_getpass( const char *prompt )
|
|||||||
#if defined(HAVE_TERMIOS_H) || defined(HAVE_SGTTY_H)
|
#if defined(HAVE_TERMIOS_H) || defined(HAVE_SGTTY_H)
|
||||||
/* tidy up */
|
/* tidy up */
|
||||||
if (fi != stdin) {
|
if (fi != stdin) {
|
||||||
fprintf(stdout, "\n");
|
fprintf(stderr, "\n");
|
||||||
fflush(stdout);
|
fflush(stderr);
|
||||||
SETFLAGS( ttyb, flags );
|
SETFLAGS( ttyb, flags );
|
||||||
if (SETATTR(fileno(fi), &ttyb) < 0)
|
if (SETATTR(fileno(fi), &ttyb) < 0)
|
||||||
perror("SETATTR");
|
perror("SETATTR");
|
||||||
|
Loading…
Reference in New Issue
Block a user