@@ -223,8 +223,8 @@ _backup_global_state(sd_bus_error *ret_error)
223
223
}
224
224
225
225
/* Copy main *.yaml files from /{etc,run,lib}/netplan/ to GLOBAL backup dir */
226
- _copy_yaml_state (NETPLAN_ROOT , path , ret_error );
227
- return 0 ;
226
+ r = _copy_yaml_state (NETPLAN_ROOT , path , ret_error );
227
+ return r ;
228
228
}
229
229
230
230
/**
@@ -444,7 +444,8 @@ netplan_try_cancelled_cb(sd_event_source *es, const siginfo_t *si, void* userdat
444
444
unlink_glob (NETPLAN_ROOT , "/{etc,run,lib}/netplan/*.yaml" );
445
445
/* Restore GLOBAL backup config state to main rootdir */
446
446
state_dir = g_strdup_printf ("%s/run/netplan/config-%s" , NETPLAN_ROOT , NETPLAN_GLOBAL_CONFIG );
447
- _copy_yaml_state (state_dir , NETPLAN_ROOT , NULL );
447
+ r = _copy_yaml_state (state_dir , NETPLAN_ROOT , NULL );
448
+ if (r < 0 ) return r ;
448
449
449
450
/* Un-invalidate all other current config objects */
450
451
if (!g_strcmp0 (d -> handler_id , d -> config_dirty ))
@@ -564,7 +565,8 @@ method_config_apply(sd_bus_message *m, void *userdata, sd_bus_error *ret_error)
564
565
unlink_glob (NETPLAN_ROOT , "/{etc,run,lib}/netplan/*.yaml" );
565
566
/* Copy current config state to GLOBAL */
566
567
state_dir = g_strdup_printf ("%s/run/netplan/config-%s" , NETPLAN_ROOT , d -> config_id );
567
- _copy_yaml_state (state_dir , NETPLAN_ROOT , ret_error );
568
+ r = _copy_yaml_state (state_dir , NETPLAN_ROOT , ret_error );
569
+ if (r < 0 ) return r ;
568
570
d -> handler_id = g_strdup (d -> config_id );
569
571
}
570
572
@@ -639,7 +641,8 @@ method_config_try(sd_bus_message *m, void *userdata, sd_bus_error *ret_error)
639
641
640
642
/* Copy current config *.yaml state to main rootdir (i.e. /etc/netplan/) */
641
643
state_dir = g_strdup_printf ("%s/run/netplan/config-%s" , NETPLAN_ROOT , d -> config_id );
642
- _copy_yaml_state (state_dir , NETPLAN_ROOT , ret_error );
644
+ r = _copy_yaml_state (state_dir , NETPLAN_ROOT , ret_error );
645
+ if (r < 0 ) return r ;
643
646
644
647
/* Exec try */
645
648
r = method_try (m , userdata , ret_error );
@@ -670,7 +673,8 @@ method_config_cancel(sd_bus_message *m, void *userdata, sd_bus_error *ret_error)
670
673
unlink_glob (NETPLAN_ROOT , "/{etc,run,lib}/netplan/*.yaml" );
671
674
/* Restore GLOBAL backup config state to main rootdir */
672
675
state_dir = g_strdup_printf ("%s/run/netplan/config-%s" , NETPLAN_ROOT , NETPLAN_GLOBAL_CONFIG );
673
- _copy_yaml_state (state_dir , NETPLAN_ROOT , ret_error );
676
+ r = _copy_yaml_state (state_dir , NETPLAN_ROOT , ret_error );
677
+ if (r < 0 ) return r ;
674
678
675
679
/* Clear GLOBAL backup and config state */
676
680
_clear_tmp_state (NETPLAN_GLOBAL_CONFIG , d );
@@ -754,7 +758,8 @@ method_config(sd_bus_message *m, void *userdata, sd_bus_error *ret_error)
754
758
}
755
759
756
760
/* Copy all *.yaml files from /{etc,run,lib}/netplan/ to temp dir */
757
- _copy_yaml_state (NETPLAN_ROOT , path , ret_error );
761
+ r = _copy_yaml_state (NETPLAN_ROOT , path , ret_error );
762
+ if (r < 0 ) return r ;
758
763
759
764
return sd_bus_reply_method_return (m , "o" , obj_path );
760
765
}
0 commit comments