X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Funistd%2Ffchdir.c;h=dee45ba68e6425a17fe2ef4f4b77038666e43d80;hb=5ef60206ff9e697d3011bcf48afca50c9fe85e1b;hp=9fbc815429e43973311b3cab56ab298224ec1b0a;hpb=9ca1f62b0c0d3e50480eb654ac941ff943ce0558;p=musl diff --git a/src/unistd/fchdir.c b/src/unistd/fchdir.c index 9fbc8154..dee45ba6 100644 --- a/src/unistd/fchdir.c +++ b/src/unistd/fchdir.c @@ -1,13 +1,13 @@ #include #include +#include #include "syscall.h" -void __procfdname(char *, unsigned); - int fchdir(int fd) { int ret = __syscall(SYS_fchdir, fd); - if (ret != -EBADF || fd < 0) return __syscall_ret(ret); + if (ret != -EBADF || __syscall(SYS_fcntl, fd, F_GETFD) < 0) + return __syscall_ret(ret); char buf[15+3*sizeof(int)]; __procfdname(buf, fd);