File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed
crates/wasi-common/src/sys/unix Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -42,8 +42,7 @@ impl StdioExt for Stdio {
42
42
}
43
43
44
44
fn get_rights ( file : & File ) -> io:: Result < HandleRights > {
45
- use yanix:: fcntl;
46
- use yanix:: file:: { isatty, OFlag } ;
45
+ use yanix:: file:: isatty;
47
46
let ( base, inheriting) = {
48
47
if unsafe { isatty ( file. as_raw_fd ( ) ) ? } {
49
48
( types:: Rights :: tty_base ( ) , types:: Rights :: tty_base ( ) )
@@ -54,13 +53,5 @@ fn get_rights(file: &File) -> io::Result<HandleRights> {
54
53
)
55
54
}
56
55
} ;
57
- let mut rights = HandleRights :: new ( base, inheriting) ;
58
- let flags = unsafe { fcntl:: get_status_flags ( file. as_raw_fd ( ) ) ? } ;
59
- let accmode = flags & OFlag :: ACCMODE ;
60
- if accmode == OFlag :: RDONLY {
61
- rights. base &= !types:: Rights :: FD_WRITE ;
62
- } else if accmode == OFlag :: WRONLY {
63
- rights. base &= !types:: Rights :: FD_READ ;
64
- }
65
- Ok ( rights)
56
+ Ok ( HandleRights :: new ( base, inheriting) )
66
57
}
You can’t perform that action at this time.
0 commit comments