X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Funistd%2Fttyname_r.c;h=8bac7b2f3ab10cb0929341ca1425af65c8d409bf;hb=a19cd2b64aabee4ae3c80bcf4ba8da26fba560e4;hp=2255e2dfebb7a5c2e8378e38879792dba88476f0;hpb=fcfba99503746e44585d7e318562dd425e8ff390;p=musl diff --git a/src/unistd/ttyname_r.c b/src/unistd/ttyname_r.c index 2255e2df..8bac7b2f 100644 --- a/src/unistd/ttyname_r.c +++ b/src/unistd/ttyname_r.c @@ -1,7 +1,7 @@ #include #include -#include -#include + +void __procfdname(char *, unsigned); int ttyname_r(int fd, char *name, size_t size) { @@ -10,7 +10,7 @@ int ttyname_r(int fd, char *name, size_t size) if (!isatty(fd)) return ENOTTY; - snprintf(procname, sizeof procname, "/proc/self/fd/%d", fd); + __procfdname(procname, fd); l = readlink(procname, name, size); if (l < 0) return errno;