Skip to content

Commit 8a6c2a1

Browse files
committed
fixing linux code
1 parent 00ec7e6 commit 8a6c2a1

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,13 +275,13 @@ pub fn apparent_size_reader(metadata: &Metadata) -> OutputSize {
275275
#[cfg(target_os = "linux")]
276276
pub fn size_block_reader(metadata: &Metadata) -> OutputSize {
277277
use std::os::linux::fs::MetadataExt;
278-
metadata.st_blocks() as OutputSize * 512
278+
Decimal::from_u64(metadata.st_blocks()).unwrap() * Decimal::new(512, 0)
279279
}
280280

281281
#[cfg(target_os = "linux")]
282282
pub fn apparent_size_reader(metadata: &Metadata) -> OutputSize {
283283
use std::os::linux::fs::MetadataExt;
284-
metadata.st_size() as OutputSize
284+
Decimal::from_u64(metadata.st_size()).unwrap()
285285
}
286286

287287
pub fn execute<SizeReader>(

0 commit comments

Comments
 (0)