From 2afabe8b830cc8c33f5f1984767af4b8dc54803b Mon Sep 17 00:00:00 2001
From: Denis Vlasenko
The BSD approach is that one has to explicitly call
-@@ -378,6 +378,8 @@ and (ii) it does not yet have a controlling tty, and (iii) maybe the tty should not already control some other session; if it does it is an error if we aren't root, or we steal the tty if we are all-powerful. +[vda: correction: third parameter controls this: if 1, we steal tty from +any such session, if 0, we don't steal]ioctl(fd, TIOCSCTTY, ...); +ioctl(fd, TIOCSCTTY, 0/1);
Opening some terminal will give us a controlling tty, provided that (i) the current process is a session leader, and (ii) it does not yet have a controlling tty, and -- cgit v1.2.3