diff options
Diffstat (limited to 'src/misc/realpath.c')
-rw-r--r-- | src/misc/realpath.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/misc/realpath.c b/src/misc/realpath.c index 18335146..d238ed01 100644 --- a/src/misc/realpath.c +++ b/src/misc/realpath.c @@ -6,6 +6,8 @@ #include <errno.h> #include <unistd.h> +void __procfdname(char *, unsigned); + char *realpath(const char *restrict filename, char *restrict resolved) { int fd; @@ -21,7 +23,7 @@ char *realpath(const char *restrict filename, char *restrict resolved) fd = open(filename, O_RDONLY|O_NONBLOCK|O_CLOEXEC); if (fd < 0) return 0; - snprintf(buf, sizeof buf, "/proc/self/fd/%d", fd); + __procfdname(buf, fd); if (!resolved) { alloc = 1; |