1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00

Merge pull request #7385 from dezgeg/build-fix

uucore: Fix proc_info compilation
This commit is contained in:
Sylvestre Ledru 2025-03-03 16:14:23 +01:00 committed by GitHub
commit 439b146b5e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -472,7 +472,7 @@ mod tests {
#[test] #[test]
fn test_thread_ids() { fn test_thread_ids() {
let main_tid = unsafe { uucore::libc::gettid() }; let main_tid = unsafe { crate::libc::gettid() };
std::thread::spawn(move || { std::thread::spawn(move || {
let mut pid_entry = ProcessInformation::try_new( let mut pid_entry = ProcessInformation::try_new(
PathBuf::from_str(&format!("/proc/{}", current_pid())).unwrap(), PathBuf::from_str(&format!("/proc/{}", current_pid())).unwrap(),
@ -482,7 +482,7 @@ mod tests {
assert!(thread_ids.contains(&(main_tid as usize))); assert!(thread_ids.contains(&(main_tid as usize)));
let new_thread_tid = unsafe { uucore::libc::gettid() }; let new_thread_tid = unsafe { crate::libc::gettid() };
assert!(thread_ids.contains(&(new_thread_tid as usize))); assert!(thread_ids.contains(&(new_thread_tid as usize)));
}) })
.join() .join()
@ -507,9 +507,9 @@ mod tests {
PathBuf::from_str(&format!("/proc/{}", current_pid())).unwrap(), PathBuf::from_str(&format!("/proc/{}", current_pid())).unwrap(),
) )
.unwrap(); .unwrap();
assert_eq!(pid_entry.uid().unwrap(), uucore::process::getuid()); assert_eq!(pid_entry.uid().unwrap(), crate::process::getuid());
assert_eq!(pid_entry.euid().unwrap(), uucore::process::geteuid()); assert_eq!(pid_entry.euid().unwrap(), crate::process::geteuid());
assert_eq!(pid_entry.gid().unwrap(), uucore::process::getgid()); assert_eq!(pid_entry.gid().unwrap(), crate::process::getgid());
assert_eq!(pid_entry.egid().unwrap(), uucore::process::getegid()); assert_eq!(pid_entry.egid().unwrap(), crate::process::getegid());
} }
} }