From d7ec001f1a69053ca11c8007d341bc5dc81f4509 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Mon, 5 Dec 2011 13:54:21 +1100 Subject: [PATCH] Set IFREG from file type, dont assume mode bits contain it Needed for HaneWin which does not set S_IFMT in the modebits returned --- lib/libnfs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/libnfs.c b/lib/libnfs.c index 1f78ca8..6fcd48a 100644 --- a/lib/libnfs.c +++ b/lib/libnfs.c @@ -686,6 +686,9 @@ static void nfs_stat_1_cb(struct rpc_context *rpc _U_, int status, void *command if (res->GETATTR3res_u.resok.obj_attributes.type == NF3DIR) { st.st_mode |= S_IFDIR ; } + if (res->GETATTR3res_u.resok.obj_attributes.type == NF3REG) { + st.st_mode |= S_IFREG ; + } 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