< prev index next >
src/java.base/unix/native/libjava/Console_md.c
Print this page
rev 51881 : 8211163: UNIX version of Java_java_io_Console_echo does not return a clean boolean
Reviewed-by: duke
*** 54,64 ****
int tty = fileno(stdin);
if (tcgetattr(tty, &tio) == -1) {
JNU_ThrowIOExceptionWithLastError(env, "tcgetattr failed");
return !on;
}
! old = (tio.c_lflag & ECHO);
if (on) {
tio.c_lflag |= ECHO;
} else {
tio.c_lflag &= ~ECHO;
}
--- 54,64 ----
int tty = fileno(stdin);
if (tcgetattr(tty, &tio) == -1) {
JNU_ThrowIOExceptionWithLastError(env, "tcgetattr failed");
return !on;
}
! old = (tio.c_lflag & ECHO) != 0;
if (on) {
tio.c_lflag |= ECHO;
} else {
tio.c_lflag &= ~ECHO;
}
< prev index next >