fdevname - Set errno if fdevname_r call fails; don't prepend /dev
authorAlex Hornung <ahornung@gmail.com>
Tue, 11 Aug 2009 09:29:45 +0000 (10:29 +0100)
committerAlex Hornung <ahornung@gmail.com>
Tue, 11 Aug 2009 11:41:43 +0000 (12:41 +0100)
commit65653ce53bb5cbe57fa398275e47fe1ce54d67f0
tree80b868bdf21173c3542d41055a7df14a804db73a
parent4998a7ac0aa83ff49b852b33f9f264c7e3c0fe21
fdevname - Set errno if fdevname_r call fails; don't prepend /dev

* Return EINVAL if the fd does not belong to a character device and
  return EBADF if the fd is not valid.

* If fdevname_r returns non-null when called from fdevname, set errno
  in fdevname to whatever *_r returned.

* Don't prepend "/dev/" string to the returned buffer, just put in
  the device name itself, without absolute path.

Reported-By: Sascha Wildner
lib/libc/gen/fdevname.c