Skip to content

Commit

Permalink
android: use proper types for dirent.d_ino, dirent.d_off, stat.st_mode
Browse files Browse the repository at this point in the history
and stat64.st_mode

This bug was noticed in termux/termux-packages#22609
  • Loading branch information
thunder-coding committed Dec 21, 2024
1 parent 1867bf3 commit e8733f1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/unix/linux_like/android/b32/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ s! {
pub st_dev: c_ulonglong,
__pad0: [c_uchar; 4],
__st_ino: crate::ino_t,
pub st_mode: c_uint,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
Expand All @@ -52,7 +52,7 @@ s! {
pub st_dev: c_ulonglong,
__pad0: [c_uchar; 4],
__st_ino: crate::ino_t,
pub st_mode: c_uint,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
Expand Down
4 changes: 2 additions & 2 deletions src/unix/linux_like/android/b64/aarch64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ s! {
pub struct stat {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
pub st_mode: c_uint,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
Expand All @@ -32,7 +32,7 @@ s! {
pub struct stat64 {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
pub st_mode: c_uint,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
Expand Down
4 changes: 2 additions & 2 deletions src/unix/linux_like/android/b64/riscv64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ s! {
pub struct stat {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
pub st_mode: c_uint,
pub st_mode: crate::mode_t,
pub st_nlink: c_uint,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
Expand All @@ -33,7 +33,7 @@ s! {
pub struct stat64 {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
pub st_mode: c_uint,
pub st_mode: crate::mode_t,
pub st_nlink: c_uint,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
Expand Down
4 changes: 2 additions & 2 deletions src/unix/linux_like/android/b64/x86_64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ s! {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
pub st_nlink: c_ulong,
pub st_mode: c_uint,
pub st_mode: crate::mode_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
Expand All @@ -31,7 +31,7 @@ s! {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
pub st_nlink: c_ulong,
pub st_mode: c_uint,
pub st_mode: crate::mode_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
Expand Down
8 changes: 4 additions & 4 deletions src/unix/linux_like/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,16 +528,16 @@ s_no_extra_traits! {
}

pub struct dirent {
pub d_ino: u64,
pub d_off: i64,
pub d_ino: crate::ino_t,
pub d_off: crate::off_t,
pub d_reclen: c_ushort,
pub d_type: c_uchar,
pub d_name: [c_char; 256],
}

pub struct dirent64 {
pub d_ino: u64,
pub d_off: i64,
pub d_ino: crate::ino64_t,
pub d_off: crate::off_t,
pub d_reclen: c_ushort,
pub d_type: c_uchar,
pub d_name: [c_char; 256],
Expand Down

0 comments on commit e8733f1

Please sign in to comment.