File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -82,10 +82,13 @@ pub(crate) fn delete_file(dest_file: PathBuf) -> std::io::Result<bool> {
82
82
return Ok ( false )
83
83
}
84
84
85
- fs:: remove_file ( & dest_file) ?;
86
- let parent_directory = dest_file. parent ( ) . unwrap ( ) ;
87
- let dir_file = fs:: OpenOptions :: new ( ) . read ( true ) . open ( parent_directory) ?;
88
- unsafe { libc:: fsync ( dir_file. as_raw_fd ( ) ) ; }
85
+ fs:: remove_file ( & dest_file) ?;
86
+ let parent_directory = dest_file. parent ( ) . unwrap ( ) ;
87
+ let dir_file = fs:: OpenOptions :: new ( ) . read ( true ) . open ( parent_directory) ?;
88
+ #[ cfg( not( target_os = "windows" ) ) ]
89
+ {
90
+ unsafe { libc:: fsync ( dir_file. as_raw_fd ( ) ) ; }
91
+ }
89
92
90
93
if dest_file. is_file ( ) {
91
94
return Err ( std:: io:: Error :: new ( std:: io:: ErrorKind :: Other , "Unpersisting key failed" ) ) ;
You can’t perform that action at this time.
0 commit comments