File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -95,11 +95,12 @@ impl File {
9595 /// Changes the permissions on the underlying file.
9696 #[ cfg( unix) ]
9797 pub async fn set_permissions ( & self , perm : Permissions ) -> io:: Result < ( ) > {
98+ use compio_driver:: syscall;
9899 use std:: os:: unix:: fs:: PermissionsExt ;
99100
100- let fd = self . as_raw_fd ( ) as _ ;
101+ let file = self . inner . try_clone ( ) ? ;
101102 compio_runtime:: spawn_blocking ( move || {
102- syscall ! ( libc:: fchmod( fd , perm. mode( ) as libc:: mode_t) ) ?;
103+ syscall ! ( libc:: fchmod( file . as_raw_fd ( ) , perm. mode( ) as libc:: mode_t) ) ?;
103104 Ok ( ( ) )
104105 } )
105106 . await
Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ impl Metadata {
147147#[ cfg( unix) ]
148148impl Metadata {
149149 /// Create from [`libc::statx`]
150- pub fn from_stat ( stat : libc:: statx ) -> Self {
150+ pub fn from_stat ( stat : libc:: stat ) -> Self {
151151 Self ( sys:: Metadata :: from_stat ( stat) )
152152 }
153153}
You can’t perform that action at this time.
0 commit comments