diff mbox series

[3/6] start_download: return EXIT_FAILURE instead of result on failures

Message ID 20220422235944.2808227-3-dominique.martinet@atmark-techno.com
State Accepted
Headers show
Series [1/6] sigchld_handler: report child exit status correctly | expand

Commit Message

Dominique Martinet April 22, 2022, 11:59 p.m. UTC
using the swupdate status from last update is not consistent with what other
modes (at least swupdate -i / swupdate-client) return, and might miss weird
conditions where result is IDLE for some reason that would be success (0 value)

return EXIT_FAILURE like the others

Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
---

This only makes sense if previous patch is applied, and doesn't matter
if it's not as that exit status is currently lost


corelib/downloader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefano Babic May 6, 2022, 7:02 a.m. UTC | #1
On 23.04.22 01:59, Dominique Martinet wrote:
> using the swupdate status from last update is not consistent with what other
> modes (at least swupdate -i / swupdate-client) return, and might miss weird
> conditions where result is IDLE for some reason that would be success (0 value)
> 
> return EXIT_FAILURE like the others
> 


Agree.


> Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
> ---
> 
> This only makes sense if previous patch is applied, and doesn't matter
> if it's not as that exit status is currently lost
> 
> 
> corelib/downloader.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/corelib/downloader.c b/corelib/downloader.c
> index 0debad0b7486..6bff9c7f2b82 100644
> --- a/corelib/downloader.c
> +++ b/corelib/downloader.c
> @@ -163,5 +163,5 @@ int start_download(const char *fname, int argc, char *argv[])
>   		free(channel_options.auth);
>   	}
>   
> -	exit(result == SUCCESS ? EXIT_SUCCESS : result);
> +	exit(result == SUCCESS ? EXIT_SUCCESS : EXIT_FAILURE);
>   }

Reviewed-by: Stefano babic <sbabic@denx.de>

Best regards,
Stefano Babic
Stefano Babic May 10, 2022, 10:37 a.m. UTC | #2
On 23.04.22 01:59, Dominique Martinet wrote:
> using the swupdate status from last update is not consistent with what other
> modes (at least swupdate -i / swupdate-client) return, and might miss weird
> conditions where result is IDLE for some reason that would be success (0 value)
> 
> return EXIT_FAILURE like the others
> 
> Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
> ---
> 
> This only makes sense if previous patch is applied, and doesn't matter
> if it's not as that exit status is currently lost
> 
> 
> corelib/downloader.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/corelib/downloader.c b/corelib/downloader.c
> index 0debad0b7486..6bff9c7f2b82 100644
> --- a/corelib/downloader.c
> +++ b/corelib/downloader.c
> @@ -163,5 +163,5 @@ int start_download(const char *fname, int argc, char *argv[])
>   		free(channel_options.auth);
>   	}
>   
> -	exit(result == SUCCESS ? EXIT_SUCCESS : result);
> +	exit(result == SUCCESS ? EXIT_SUCCESS : EXIT_FAILURE);
>   }

Applied to -master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/corelib/downloader.c b/corelib/downloader.c
index 0debad0b7486..6bff9c7f2b82 100644
--- a/corelib/downloader.c
+++ b/corelib/downloader.c
@@ -163,5 +163,5 @@  int start_download(const char *fname, int argc, char *argv[])
 		free(channel_options.auth);
 	}
 
-	exit(result == SUCCESS ? EXIT_SUCCESS : result);
+	exit(result == SUCCESS ? EXIT_SUCCESS : EXIT_FAILURE);
 }