Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 17d03b9

Browse filesBrowse files
committed
Check that we get somewhat sane PIDs when spawning with pidfds
1 parent 4c9a96e commit 17d03b9
Copy full SHA for 17d03b9

File tree

Expand file treeCollapse file tree

1 file changed

+3
-0
lines changed
Filter options
  • std/src/sys/pal/unix/linux/pidfd
Expand file treeCollapse file tree

1 file changed

+3
-0
lines changed

‎std/src/sys/pal/unix/linux/pidfd/tests.rs

Copy file name to clipboardExpand all lines: std/src/sys/pal/unix/linux/pidfd/tests.rs
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ fn test_command_pidfd() {
2121
let flags = super::cvt(unsafe { libc::fcntl(pidfd.as_raw_fd(), libc::F_GETFD) }).unwrap();
2222
assert!(flags & libc::FD_CLOEXEC != 0);
2323
}
24+
assert!(child.id() > 0 && child.id() < -1i32 as u32);
2425
let status = child.wait().expect("error waiting on pidfd");
2526
assert_eq!(status.code(), Some(1));
2627

@@ -47,6 +48,8 @@ fn test_command_pidfd() {
4748
let mut child =
4849
unsafe { Command::new("false").pre_exec(|| Ok(())) }.create_pidfd(true).spawn().unwrap();
4950

51+
assert!(child.id() > 0 && child.id() < -1i32 as u32);
52+
5053
if pidfd_open_available {
5154
assert!(child.pidfd().is_ok())
5255
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.