File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -282,7 +282,18 @@ impl CoreUtils {
282
282
}
283
283
Err ( e) => return Err ( e) ,
284
284
}
285
- ctl. set_value_string ( val)
285
+ let result = ctl. set_value_string ( val) ;
286
+ // if we have a read only /proc we ignore it as well
287
+ match result {
288
+ Ok ( _) => result,
289
+ Err ( SysctlError :: IoError ( e) ) => {
290
+ if e. raw_os_error ( ) == Some ( libc:: EROFS ) {
291
+ return Ok ( String :: from ( "" ) ) ;
292
+ }
293
+ return Err ( e. into ( ) ) ;
294
+ } ,
295
+ Err ( err) => return Err ( err) ,
296
+ }
286
297
}
287
298
}
288
299
@@ -433,9 +444,6 @@ pub fn disable_ipv6_autoconf(if_name: &str) -> NetavarkResult<()> {
433
444
// just ignore that case
434
445
}
435
446
436
- // if we have a read only /proc we ignore it as well
437
- SysctlError :: IoError ( ref e) if e. raw_os_error ( ) == Some ( libc:: EROFS ) => { }
438
-
439
447
_ => {
440
448
return Err ( NetavarkError :: wrap (
441
449
"failed to set autoconf sysctl" ,
You can’t perform that action at this time.
0 commit comments