# HG changeset patch # User Paul Boddie # Date 1645738500 -3600 # Node ID 3877ffdab6cc164549049e4db2190c29cbb4d8a7 # Parent dd4fc2b5a18c7322b005de46aa06a1e0f3cee5e8 Added the number of blocks to the stat result. diff -r dd4fc2b5a18c -r 3877ffdab6cc libe2access/lib/src/image.c --- a/libe2access/lib/src/image.c Thu Feb 24 22:34:43 2022 +0100 +++ b/libe2access/lib/src/image.c Thu Feb 24 22:35:00 2022 +0100 @@ -644,6 +644,8 @@ if (retval) return retval; + /* NOTE: Could access large inode members and other information. */ + st->st_dev = 0; /* device identifier */ st->st_ino = ino; st->st_mode = inode.i_mode; @@ -653,7 +655,7 @@ st->st_rdev = 0; /* special file device identifier */ st->st_size = EXT2_I_SIZE(&inode); st->st_blksize = fs->blocksize; - st->st_blocks = 0; /* number of 512 byte blocks allocated */ + st->st_blocks = inode.i_blocks; /* number of 512 byte blocks allocated */ st->st_atim.tv_sec = inode.i_atime; st->st_atim.tv_nsec = 0; /* nanosecond resolution */ st->st_mtim.tv_sec = inode.i_mtime;