Set IFREG from file type, dont assume mode bits contain it
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Mon, 5 Dec 2011 02:54:21 +0000 (13:54 +1100)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Mon, 5 Dec 2011 02:54:21 +0000 (13:54 +1100)
Needed for HaneWin which does not set S_IFMT in the modebits returned

lib/libnfs.c

index 1f78ca8b8fe9dacc3cc108556271e1ed9f2ad933..6fcd48ae193706ba44c83d9442aec71f18fd9ace 100644 (file)
@@ -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;