From 37df236504e10dbbdb499849dbbc3731414e8839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=BD=A9=E6=81=8B?= Date: Mon, 6 Apr 2026 01:13:36 +0800 Subject: [PATCH] fix: fix integer type conversion to support Android and 32-bit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 白彩恋 (cherry picked from commit 48e6431869424d6d2d39aaf4c0ad08a07a46bfe0) --- src/sed/fast_io.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sed/fast_io.rs b/src/sed/fast_io.rs index dff21b9..2e2403a 100644 --- a/src/sed/fast_io.rs +++ b/src/sed/fast_io.rs @@ -384,11 +384,11 @@ impl FastCopy { panic!("fstat failed on fd {}: {}", fd, err); } - let ftype = st.st_mode & libc::S_IFMT; + let ftype = st.st_mode as libc::mode_t & libc::S_IFMT; Self { fd, - is_regular: ftype == libc::S_IFREG, + is_regular: ftype as libc::mode_t == libc::S_IFREG, block_size: st.st_blksize as usize, } } @@ -754,7 +754,7 @@ impl OutputBuffer { chunk.out_ptr, chunk.in_fast_copy.fd, // Input file offset - unsafe { chunk.out_ptr.offset_from(chunk.base_ptr) } as i64, + unsafe { chunk.out_ptr.offset_from(chunk.base_ptr) } as libc::off_t, self.fast_copy.fd, chunk.len, // Alignment block size: the largest of the two