mirror of
https://github.com/KDE/konsole.git
synced 2026-05-18 11:35:52 -04:00
Do not forget closing /dev/tty after opening it.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user