diff mbox series

[3/4] install_from_file: run post update command on success

Message ID 20210408052542.3509794-3-dominique.martinet@atmark-techno.com
State Accepted
Headers show
Series [1/4] archive_handler: make 'missing path attribute' message an ERROR | expand

Commit Message

Dominique Martinet April 8, 2021, 5:25 a.m. UTC
Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
---
 core/install_from_file.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Stefano Babic April 8, 2021, 4:32 p.m. UTC | #1
On 08.04.21 07:25, Dominique Martinet wrote:
> Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
> ---
>   core/install_from_file.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/core/install_from_file.c b/core/install_from_file.c
> index 680f6d58105f..1606fc5072f7 100644
> --- a/core/install_from_file.c
> +++ b/core/install_from_file.c
> @@ -55,6 +55,14 @@ static int endupdate(RECOVERY_STATUS status)
>   		status == FAILURE ? "*failed* !" :
>   			"was successful !");
>   
> +	if (status == SUCCESS) {
> +		ipc_message msg;
> +		msg.data.procmsg.len = 0;
> +		if (ipc_postupdate(&msg) != 0 || msg.type != ACK) {
> +			end_status = EXIT_FAILURE;
> +		}
> +	}
> +
>   	pthread_mutex_lock(&mymutex);
>   	pthread_cond_signal(&cv_end);
>   	pthread_mutex_unlock(&mymutex);
> 

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic
Stefano Babic April 17, 2021, 9:44 a.m. UTC | #2
On 08.04.21 07:25, Dominique Martinet wrote:
> Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
> ---
>   core/install_from_file.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/core/install_from_file.c b/core/install_from_file.c
> index 680f6d58105f..1606fc5072f7 100644
> --- a/core/install_from_file.c
> +++ b/core/install_from_file.c
> @@ -55,6 +55,14 @@ static int endupdate(RECOVERY_STATUS status)
>   		status == FAILURE ? "*failed* !" :
>   			"was successful !");
>   
> +	if (status == SUCCESS) {
> +		ipc_message msg;
> +		msg.data.procmsg.len = 0;
> +		if (ipc_postupdate(&msg) != 0 || msg.type != ACK) {
> +			end_status = EXIT_FAILURE;
> +		}
> +	}
> +
>   	pthread_mutex_lock(&mymutex);
>   	pthread_cond_signal(&cv_end);
>   	pthread_mutex_unlock(&mymutex);
> 

Applied to -master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/core/install_from_file.c b/core/install_from_file.c
index 680f6d58105f..1606fc5072f7 100644
--- a/core/install_from_file.c
+++ b/core/install_from_file.c
@@ -55,6 +55,14 @@  static int endupdate(RECOVERY_STATUS status)
 		status == FAILURE ? "*failed* !" :
 			"was successful !");
 
+	if (status == SUCCESS) {
+		ipc_message msg;
+		msg.data.procmsg.len = 0;
+		if (ipc_postupdate(&msg) != 0 || msg.type != ACK) {
+			end_status = EXIT_FAILURE;
+		}
+	}
+
 	pthread_mutex_lock(&mymutex);
 	pthread_cond_signal(&cv_end);
 	pthread_mutex_unlock(&mymutex);