Do not forget closing /dev/tty after opening it.

wilder-portage
Jekyll Wu 14 years ago
parent 6bf21efc99
commit ae7eae3e33
  1. 4
      src/main.cpp

@ -142,8 +142,10 @@ bool shouldUseNewProcess()
// Konsole and any debug output or warnings from Konsole are written to
// the current terminal
bool hasControllingTTY = false;
if (KDE_open("/dev/tty", O_RDONLY) != -1) {
const int fd = KDE_open("/dev/tty", O_RDONLY);
if (fd != -1) {
hasControllingTTY = true;
close(fd);
}
return hasControllingTTY;

Loading…
Cancel
Save