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 {
4242}
4343
4444fn get_rights ( file : & File ) -> io:: Result < HandleRights > {
45- use yanix:: fcntl;
46- use yanix:: file:: { isatty, OFlag } ;
45+ use yanix:: file:: isatty;
4746 let ( base, inheriting) = {
4847 if unsafe { isatty ( file. as_raw_fd ( ) ) ? } {
4948 ( types:: Rights :: tty_base ( ) , types:: Rights :: tty_base ( ) )
@@ -54,13 +53,5 @@ fn get_rights(file: &File) -> io::Result<HandleRights> {
5453 )
5554 }
5655 } ;
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) )
6657}
You can’t perform that action at this time.
0 commit comments