X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Funistd%2Fttyname_r.c;h=82acb75e19d60a6a075e7398dc23d9b4f8729e5d;hb=613ccabeb0c10ac818e36ef53e09753d23785cbf;hp=33aa4ae1a73672f87307b1bd9aababf7508b8e98;hpb=e1232f5b5185e8f337806841018369407e32e77d;p=musl diff --git a/src/unistd/ttyname_r.c b/src/unistd/ttyname_r.c index 33aa4ae1..82acb75e 100644 --- a/src/unistd/ttyname_r.c +++ b/src/unistd/ttyname_r.c @@ -1,8 +1,7 @@ #include #include #include - -void __procfdname(char *, unsigned); +#include "syscall.h" int ttyname_r(int fd, char *name, size_t size) { @@ -10,7 +9,7 @@ int ttyname_r(int fd, char *name, size_t size) char procname[sizeof "/proc/self/fd/" + 3*sizeof(int) + 2]; ssize_t l; - if (!isatty(fd)) return ENOTTY; + if (!isatty(fd)) return errno; __procfdname(procname, fd); l = readlink(procname, name, size);