diff --git a/nmap_tty.cc b/nmap_tty.cc index 8c748bc23..09145411f 100644 --- a/nmap_tty.cc +++ b/nmap_tty.cc @@ -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()) {