Skip to content

Commit e5fe6c6

Browse files
Merge pull request #123 from balena-io-modules/ryan/filesize
Fix fs.stat for large file sizes
2 parents 7028be1 + 34e52e8 commit e5fe6c6

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

.github/workflows/flowzone.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@ jobs:
1414
(github.event.pull_request.head.repo.full_name == github.repository && github.event_name == 'pull_request') ||
1515
(github.event.pull_request.head.repo.full_name != github.repository && github.event_name == 'pull_request_target')
1616
uses: product-os/flowzone/.github/workflows/flowzone.yml@master
17-
secrets: inherit
18-
with: {}
17+
secrets: inherit

src/glue.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,8 @@ errcode_t update_xtime(ext2_file_t file, bool a, bool c, bool m) {
283283
return err;
284284
}
285285

286-
unsigned long getUInt64Number(unsigned long long hi, unsigned long long lo) {
287-
return lo | (hi << 32);
286+
double getUInt64Number(unsigned long long hi, unsigned long long lo) {
287+
return (double) ((hi << 32) | lo);
288288
}
289289
// ------------------------
290290

@@ -1377,7 +1377,7 @@ int node_ext2fs_stat_blocksize(ext2_file_t file) {
13771377
return file->fs->blocksize;
13781378
}
13791379

1380-
unsigned long node_ext2fs_stat_i_size(ext2_file_t file) {
1380+
double node_ext2fs_stat_i_size(ext2_file_t file) {
13811381
return getUInt64Number(file->inode.i_size_high, file->inode.i_size);
13821382
}
13831383

0 commit comments

Comments
 (0)