mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-01 13:01:21 -03:00
Convert fish_mkstemp_cloexec() to return an OwnedFd
This commit is contained in:
@@ -60,13 +60,8 @@ fn test_wdirname_wbasename() {
|
||||
#[serial]
|
||||
fn test_wwrite_to_fd() {
|
||||
test_init();
|
||||
let (fd, filename) =
|
||||
fish_mkstemp_cloexec(CString::new("/tmp/fish_test_wwrite.XXXXXX").unwrap());
|
||||
{
|
||||
let mut tmpfd = AutoCloseFd::new(fd);
|
||||
assert!(tmpfd.is_valid());
|
||||
tmpfd.close();
|
||||
}
|
||||
let (_fd, filename) =
|
||||
fish_mkstemp_cloexec(CString::new("/tmp/fish_test_wwrite.XXXXXX").unwrap()).unwrap();
|
||||
let sizes = [1, 2, 3, 5, 13, 23, 64, 128, 255, 4096, 4096 * 2];
|
||||
for &size in &sizes {
|
||||
let fd = AutoCloseFd::new(unsafe {
|
||||
|
||||
Reference in New Issue
Block a user