cttyhack: print detected ctty name when called without parameters
authorAlexander Shishkin <virtuoso@slind.org>
Mon, 31 Oct 2011 12:18:44 +0000 (13:18 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Mon, 31 Oct 2011 12:18:44 +0000 (13:18 +0100)
commit156840c249ddf761d9e60b06ca6d8aaa1bf88402
tree927112b5656f671980e8db99d11cbb74a6457118
parentbcdae638752d5eac9185f69b88f49ed136cf39af
cttyhack: print detected ctty name when called without parameters

Sometimes there's a need to figure out the controlling tty from a shell
script, for example, to obtain a line for getty. In this case it's easier
to call cttyhack than trying to repeat some of the cttyhack's logic.

function                                             old     new   delta
cttyhack_main                                        283     327     +44
packed_usage                                       28911   28915      +4

Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
shell/cttyhack.c