File tree 1 file changed +15
-3
lines changed 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -700,15 +700,15 @@ mender_client_initialization_work_function(void) {
700
700
if (MENDER_OK != (ret = mender_storage_get_deployment_data (& deployment_data ))) {
701
701
if (MENDER_NOT_FOUND != ret ) {
702
702
mender_log_error ("Unable to get deployment data" );
703
- goto END ;
703
+ goto REBOOT ;
704
704
}
705
705
}
706
706
if (NULL != deployment_data ) {
707
707
if (NULL == (mender_client_deployment_data = cJSON_Parse (deployment_data ))) {
708
- mender_log_error ("Unable to allocate memory " );
708
+ mender_log_error ("Unable to parse deployment data " );
709
709
free (deployment_data );
710
710
ret = MENDER_FAIL ;
711
- goto END ;
711
+ goto REBOOT ;
712
712
}
713
713
free (deployment_data );
714
714
}
@@ -717,6 +717,18 @@ mender_client_initialization_work_function(void) {
717
717
718
718
END :
719
719
720
+ return ret ;
721
+
722
+ REBOOT :
723
+
724
+ /* Delete pending deployment */
725
+ mender_storage_delete_deployment_data ();
726
+
727
+ /* Invoke restart callback, application is responsible to shutdown properly and restart the system */
728
+ if (NULL != mender_client_callbacks .restart ) {
729
+ mender_client_callbacks .restart ();
730
+ }
731
+
720
732
return ret ;
721
733
}
722
734
You can’t perform that action at this time.
0 commit comments