summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/stat/fstat.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/stat/fstat.c b/src/stat/fstat.c
index d2a828f3..07f9a5de 100644
--- a/src/stat/fstat.c
+++ b/src/stat/fstat.c
@@ -6,6 +6,7 @@
int fstat(int fd, struct stat *st)
{
+ if (fd<0) return __syscall_ret(-EBADF);
return fstatat(fd, "", st, AT_EMPTY_PATH);
}