X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmisc%2Frealpath.c;h=88c849cda33de1e285a5b1eec7dfe9c222d013e5;hb=43e9f652bf4b2195b04fc14c93db591b30a7b790;hp=43d4018358f718c69455192930ec73ffe540e4de;hpb=dfddd43256f7ad4bad991eeff5cc51772595f327;p=musl diff --git a/src/misc/realpath.c b/src/misc/realpath.c index 43d40183..88c849cd 100644 --- a/src/misc/realpath.c +++ b/src/misc/realpath.c @@ -1,11 +1,11 @@ #include -#include #include #include #include #include #include #include +#include "syscall.h" void __procfdname(char *, unsigned); @@ -22,7 +22,7 @@ char *realpath(const char *restrict filename, char *restrict resolved) return 0; } - fd = open(filename, O_PATH|O_NONBLOCK|O_CLOEXEC); + fd = sys_open(filename, O_PATH|O_NONBLOCK|O_CLOEXEC); if (fd < 0) return 0; __procfdname(buf, fd); @@ -37,9 +37,9 @@ char *realpath(const char *restrict filename, char *restrict resolved) goto err; } - close(fd); + __syscall(SYS_close, fd); return resolved ? strcpy(resolved, tmp) : strdup(tmp); err: - close(fd); + __syscall(SYS_close, fd); return 0; }