File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -544,9 +544,11 @@ impl Default for FileTimes {
544
544
fn default ( ) -> Self {
545
545
// Redox doesn't appear to support `UTIME_OMIT`, so we stub it out here, and always return
546
546
// an error in `set_times`.
547
- #[ cfg( target_os = "redox" ) ]
547
+ // ESP-IDF does not support `futimens` at all and the behavior for that OS is therefore
548
+ // the same as for Redox.
549
+ #[ cfg( any( target_os = "redox" , target_os = "espidf" ) ) ]
548
550
let omit = libc:: timespec { tv_sec : 0 , tv_nsec : 0 } ;
549
- #[ cfg( not( target_os = "redox" ) ) ]
551
+ #[ cfg( not( any ( target_os = "redox" , target_os = "espidf" ) ) ) ]
550
552
let omit = libc:: timespec { tv_sec : 0 , tv_nsec : libc:: UTIME_OMIT as _ } ;
551
553
Self ( [ omit; 2 ] )
552
554
}
@@ -1077,8 +1079,10 @@ impl File {
1077
1079
1078
1080
pub fn set_times ( & self , times : FileTimes ) -> io:: Result < ( ) > {
1079
1081
cfg_if:: cfg_if! {
1080
- if #[ cfg( target_os = "redox" ) ] {
1082
+ if #[ cfg( any ( target_os = "redox" , target_os = "espidf" ) ) ] {
1081
1083
// Redox doesn't appear to support `UTIME_OMIT`.
1084
+ // ESP-IDF does not support `futimens` at all and the behavior for that OS is therefore
1085
+ // the same as for Redox.
1082
1086
drop( times) ;
1083
1087
Err ( io:: const_io_error!(
1084
1088
io:: ErrorKind :: Unsupported ,
You can’t perform that action at this time.
0 commit comments