From: Ronnie Sahlberg Date: Sun, 19 Jun 2011 15:02:48 +0000 (+1000) Subject: From Paul van der Zwan X-Git-Tag: upstream/1.9.6^2~392 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=e8cab72a79a0ebdb36adcb50201de6e92945c1a6;p=deb_libnfs.git From Paul van der Zwan Set the directory bit in st_mode properly. --- 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;