4998a7ac Tue Aug 11 09:19:57 GMT 2009 Alex Hornung <ahornung@gmail.com> ttyname(3) - Set errno if ttyname_r call fails
* If ttyname_r returns non-null when called from ttyname, set errno in ttyname to whatever *_r returned. This also makes our ttyname comply with the standard.