From e8cab72a79a0ebdb36adcb50201de6e92945c1a6 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Mon, 20 Jun 2011 01:02:48 +1000 Subject: [PATCH] From Paul van der Zwan Set the directory bit in st_mode properly. --- lib/libnfs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/libnfs.c b/lib/libnfs.c index c637a75..905e9d8 100644 --- a/lib/libnfs.c +++ b/lib/libnfs.c @@ -646,6 +646,9 @@ static void nfs_stat_1_cb(struct rpc_context *rpc _U_, int status, void *command st.st_dev = -1; st.st_ino = res->GETATTR3res_u.resok.obj_attributes.fileid; st.st_mode = res->GETATTR3res_u.resok.obj_attributes.mode; + if (res->GETATTR3res_u.resok.obj_attributes.type == NF3DIR) { + st.st_mode |= S_IFDIR ; + } st.st_nlink = res->GETATTR3res_u.resok.obj_attributes.nlink; st.st_uid = res->GETATTR3res_u.resok.obj_attributes.uid; st.st_gid = res->GETATTR3res_u.resok.obj_attributes.gid; -- 2.34.1