Skip to content

Commit dc3b011

Browse files
committed
add changelog entry
1 parent b7e2dc1 commit dc3b011

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

changelog/2525.added.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add `close_range` in unistd for Linux/glibc and FreeBSD

test/test_unistd.rs

+12-3
Original file line numberDiff line numberDiff line change
@@ -1393,7 +1393,10 @@ fn test_group_from() {
13931393
}
13941394

13951395
#[test]
1396-
#[cfg(any(all(target_os = "linux", target_env = "gnu"), target_os = "freebsd"))]
1396+
#[cfg(any(
1397+
all(target_os = "linux", target_env = "gnu"),
1398+
target_os = "freebsd"
1399+
))]
13971400
fn test_close_range() {
13981401
use tempfile::NamedTempFile;
13991402
const CONTENTS: &[u8] = b"abcdef123456";
@@ -1403,6 +1406,12 @@ fn test_close_range() {
14031406
tempfile3.write_all(CONTENTS).unwrap();
14041407
tempfile2.write_all(CONTENTS).unwrap();
14051408
tempfile1.write_all(CONTENTS).unwrap();
1406-
let areclosed = close_range(tempfile1, tempfile3, CloseRangeFlags::CLOSE_RANGE_CLOEXEC);
1407-
assert_eq!(areclosed.expect("close_range failed").expect("invalid flag"), 0);
1409+
let areclosed =
1410+
close_range(tempfile1, tempfile3, CloseRangeFlags::CLOSE_RANGE_CLOEXEC);
1411+
assert_eq!(
1412+
areclosed
1413+
.expect("close_range failed")
1414+
.expect("invalid flag"),
1415+
0
1416+
);
14081417
}

0 commit comments

Comments
 (0)