Skip to content

Commit 151bd4a

Browse files
committed
handle 32bit inode sizes
1 parent 25fe57f commit 151bd4a

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/fs_inode.hpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,16 @@ namespace fs
3434
void
3535
recompute(struct stat &st)
3636
{
37-
/*
38-
Some OSes have 32-bit device IDs, so box this up first.
39-
This does also presume a 64-bit inode value.
40-
*/
41-
uint64_t st_dev = (uint64_t)st.st_dev;
42-
st.st_ino |= (st_dev << 32);
37+
switch(sizeof(st.st_ino))
38+
{
39+
case 4:
40+
st.st_ino |= ((uint32_t)st.st_dev << 16);
41+
break;
42+
case 8:
43+
default:
44+
st.st_ino |= ((uint64_t)st.st_dev << 32);
45+
break;
46+
}
4347
}
4448
}
4549
}

0 commit comments

Comments
 (0)