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() {
88
88
let name_ptr = name. as_bytes ( ) . as_ptr ( ) . cast :: < libc:: c_char > ( ) ;
89
89
unsafe {
90
90
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
+
91
94
let mut first_buf = [ 0u8 ; 4 ] ;
92
95
libc:: read ( fd, first_buf. as_mut_ptr ( ) as * mut libc:: c_void , 4 ) ;
93
96
assert_eq ! ( & first_buf, b"dup " ) ;
94
97
95
- let new_fd = libc:: dup ( fd) ;
96
98
let mut second_buf = [ 0u8 ; 4 ] ;
97
99
libc:: read ( new_fd, second_buf. as_mut_ptr ( ) as * mut libc:: c_void , 4 ) ;
98
100
assert_eq ! ( & second_buf, b"and " ) ;
99
101
100
- let new_fd2 = libc:: dup2 ( fd, 8 ) ;
101
102
let mut third_buf = [ 0u8 ; 4 ] ;
102
103
libc:: read ( new_fd2, third_buf. as_mut_ptr ( ) as * mut libc:: c_void , 4 ) ;
103
104
assert_eq ! ( & third_buf, b"dup2" ) ;
You can’t perform that action at this time.
0 commit comments