summaryrefslogtreecommitdiff
path: root/src/unistd/ctermid.c
AgeCommit message (Collapse)AuthorLines
2015-01-12simplify ctermidRich Felker-14/+2
opening /dev/tty then using ttyname_r on it does not produce a canonical terminal name; it simply yields "/dev/tty". it would be possible to make ctermid determine the actual controlling terminal device via field 7 of /proc/self/stat, but doing so would introduce a buffer overflow into applications built with L_ctermid==9, which glibc defines, adversely affecting the quality of ABI compat.
2013-12-12include cleanups: remove unused headers and add feature test macrosSzabolcs Nagy-2/+0
2013-07-09fix bogus lazy allocation in ctermid and missing malloc failure checkRich Felker-10/+7
also clean up, optimize, and simplify the code, removing branches by simply pre-setting the result string to an empty string, which will be preserved if other operations fail.
2013-07-09fix fd leak on races and cancellation in ctermidRich Felker-2/+3
2011-02-12initial check-in, version 0.5.0v0.5.0Rich Felker-0/+23