File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
src/tools/miri/tests/pass-dep/libc Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -88,16 +88,17 @@ fn test_dup() {
8888 let name_ptr = name. as_bytes ( ) . as_ptr ( ) . cast :: < libc:: c_char > ( ) ;
8989 unsafe {
9090 let fd = libc:: open ( name_ptr, libc:: O_RDONLY ) ;
91+ let new_fd = libc:: dup ( fd) ;
92+ let new_fd2 = libc:: dup2 ( fd, 8 ) ;
93+
9194 let mut first_buf = [ 0u8 ; 4 ] ;
9295 libc:: read ( fd, first_buf. as_mut_ptr ( ) as * mut libc:: c_void , 4 ) ;
9396 assert_eq ! ( & first_buf, b"dup " ) ;
9497
95- let new_fd = libc:: dup ( fd) ;
9698 let mut second_buf = [ 0u8 ; 4 ] ;
9799 libc:: read ( new_fd, second_buf. as_mut_ptr ( ) as * mut libc:: c_void , 4 ) ;
98100 assert_eq ! ( & second_buf, b"and " ) ;
99101
100- let new_fd2 = libc:: dup2 ( fd, 8 ) ;
101102 let mut third_buf = [ 0u8 ; 4 ] ;
102103 libc:: read ( new_fd2, third_buf. as_mut_ptr ( ) as * mut libc:: c_void , 4 ) ;
103104 assert_eq ! ( & third_buf, b"dup2" ) ;
You can’t perform that action at this time.
0 commit comments