File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -163,8 +163,7 @@ libc_bitflags!(
163
163
164
164
pub fn open < P : ?Sized + NixPath > ( path : & P , oflag : OFlag , mode : Mode ) -> Result < RawFd > {
165
165
let fd = path. with_nix_path ( |cstr| {
166
- let modebits = c_uint:: from ( mode. bits ( ) ) ;
167
- unsafe { libc:: open ( cstr. as_ptr ( ) , oflag. bits ( ) , modebits) }
166
+ unsafe { libc:: open ( cstr. as_ptr ( ) , oflag. bits ( ) , mode. bits ( ) as c_uint ) }
168
167
} ) ?;
169
168
170
169
Errno :: result ( fd)
@@ -178,8 +177,7 @@ pub fn openat<P: ?Sized + NixPath>(
178
177
mode : Mode ,
179
178
) -> Result < RawFd > {
180
179
let fd = path. with_nix_path ( |cstr| {
181
- let modebits = c_uint:: from ( mode. bits ( ) ) ;
182
- unsafe { libc:: openat ( dirfd, cstr. as_ptr ( ) , oflag. bits ( ) , modebits) }
180
+ unsafe { libc:: openat ( dirfd, cstr. as_ptr ( ) , oflag. bits ( ) , mode. bits ( ) as c_uint ) }
183
181
} ) ?;
184
182
Errno :: result ( fd)
185
183
}
You can’t perform that action at this time.
0 commit comments