From: Ronnie Sahlberg Date: Mon, 5 Dec 2011 02:54:21 +0000 (+1100) Subject: Set IFREG from file type, dont assume mode bits contain it X-Git-Tag: upstream/1.9.6^2~281 X-Git-Url: https://git.piment-noir.org/?p=deb_libnfs.git;a=commitdiff_plain;h=d7ec001f1a69053ca11c8007d341bc5dc81f4509 Set IFREG from file type, dont assume mode bits contain it Needed for HaneWin which does not set S_IFMT in the modebits returned --- 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;