Don't bother with interactive input if we can't open the TTY. See #2042

This commit is contained in:
dmiller 2022-09-23 14:49:40 +00:00
parent 6fd0261731
commit 10862c46e8

View file

@ -224,7 +224,10 @@ void tty_init()
if (tty_fd)
return;
if ((tty_fd = open("/dev/tty", O_RDONLY | O_NONBLOCK)) < 0) return;
if ((tty_fd = open("/dev/tty", O_RDONLY | O_NONBLOCK)) < 0) {
o.noninteractive = true;
return;
}
#ifndef __CYGWIN32__
if (tcgetpgrp(tty_fd) != getpgrp()) {