From a16be4e9dba25154d4245e721bacb7b8fda0fd35 Mon Sep 17 00:00:00 2001 From: Sohei Koyama Date: Mon, 7 Oct 2024 01:13:23 +0900 Subject: [PATCH] fix dirfd --- client/libfinchrun.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/libfinchrun.c b/client/libfinchrun.c index 190d940..b6a6c74 100644 --- a/client/libfinchrun.c +++ b/client/libfinchrun.c @@ -796,7 +796,7 @@ hook_mkdirat(long a1, long a2, long a3, long a4, long a5, long a6, long a7) char *path = (char *)a3; mode_t mode = (mode_t)a4; int ret; - if (dirfd == AT_FDCWD && strncmp(path, prefix, prefix_len) == 0) { + if (strncmp(path, prefix, prefix_len) == 0) { path += prefix_len; ret = finchfs_mkdir(path, mode); return ret < 0 ? -errno : ret; @@ -824,7 +824,7 @@ hook_newfstatat(long a1, long a2, long a3, long a4, long a5, long a6, long a7) struct stat *st = (struct stat *)a4; int flags = (int)a5; int ret; - if (dirfd == AT_FDCWD && strncmp(pathname, prefix, prefix_len) == 0) { + if (strncmp(pathname, prefix, prefix_len) == 0) { pathname += prefix_len; ret = finchfs_stat(pathname, st); return ret < 0 ? -errno : ret;