]> wimlib.net Git - wimlib/blobdiff - src/dentry.c
hardlinks (IN PROGRESS)
[wimlib] / src / dentry.c
index e5af01ba695a4d0963d2a46a894b5609d3fa1905..e47f8380e2fdffabb3b7aca7d2967c1d07c8c7bf 100644 (file)
@@ -80,6 +80,11 @@ void stbuf_to_dentry(const struct stat *stbuf, struct dentry *dentry)
        } else {
                dentry->attributes = FILE_ATTRIBUTE_NORMAL;
        }
+       if (sizeof(ino_t) >= 8)
+               dentry->hard_link = (u64)stbuf->st_ino;
+       else
+               dentry->hard_link = (u64)stbuf->st_ino |
+                                  ((u64)stbuf->st_dev << (sizeof(ino_t) * 8));
 }
 
 /* Transfers file attributes from a struct dentry to a `stat' buffer. */