File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ pub fn os_open(vm: &VirtualMachine, args: PyFuncArgs) -> PyResult {
132
132
fn _set_file_model ( flags : & PyObjectRef ) -> OpenOptions {
133
133
let flags = objint:: get_value ( flags) . to_i32 ( ) . unwrap ( ) ;
134
134
let mut options = OpenOptions :: new ( ) ;
135
- options. read ( flags & libc:: O_RDONLY != 0 ) ;
135
+ options. read ( flags == libc:: O_RDONLY ) ;
136
136
options. write ( flags & libc:: O_WRONLY != 0 ) ;
137
137
options. append ( flags & libc:: O_APPEND != 0 ) ;
138
138
options. custom_flags ( flags) ;
@@ -143,7 +143,7 @@ fn _set_file_model(flags: &PyObjectRef) -> OpenOptions {
143
143
fn _set_file_model ( flags : & PyObjectRef ) -> OpenOptions {
144
144
let flags = objint:: get_value ( flags) . to_u32 ( ) . unwrap ( ) ;
145
145
let mut options = OpenOptions :: new ( ) ;
146
- options. read ( ( flags as i32 ) & libc :: O_RDONLY ! = libc:: O_RDONLY ) ;
146
+ options. read ( ( flags as i32 ) = = libc:: O_RDONLY ) ;
147
147
options. write ( ( flags as i32 ) & libc:: O_WRONLY != 0 ) ;
148
148
options. append ( ( flags as i32 ) & libc:: O_APPEND != 0 ) ;
149
149
options. custom_flags ( flags) ;
You can’t perform that action at this time.
0 commit comments