File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -1065,7 +1065,21 @@ impl Document {
1065
1065
let write_result: anyhow:: Result < _ > = async {
1066
1066
let mut dst = tokio:: fs:: File :: create ( & write_path) . await ?;
1067
1067
to_writer ( & mut dst, encoding_with_bom_info, & text) . await ?;
1068
- dst. sync_all ( ) . await ?;
1068
+ // Ignore ENOTSUP/EOPNOTSUPP (Operation not supported) errors from sync_all()
1069
+ // This is known to occur on SMB filesystems on macOS where fsync is not supported
1070
+ if let Err ( e) = dst. sync_all ( ) . await {
1071
+ #[ cfg( target_os = "macos" ) ]
1072
+ {
1073
+ match e. raw_os_error ( ) {
1074
+ Some ( 45 ) | Some ( 102 ) => { } , // ENOTSUP or EOPNOTSUPP - ignore
1075
+ _ => return Err ( e. into ( ) ) ,
1076
+ }
1077
+ }
1078
+ #[ cfg( not( target_os = "macos" ) ) ]
1079
+ {
1080
+ return Err ( e. into ( ) ) ;
1081
+ }
1082
+ }
1069
1083
Ok ( ( ) )
1070
1084
}
1071
1085
. await ;
You can’t perform that action at this time.
0 commit comments