diff mbox series

_progress_ipc_connect: in case of reconnect option disabled return error instead of exit

Message ID 20200524175319.9908-1-ayoub.zaki@embexus.com
State Accepted
Headers show
Series _progress_ipc_connect: in case of reconnect option disabled return error instead of exit | expand

Commit Message

Ayoub Zaki May 24, 2020, 5:53 p.m. UTC
Signed-off-by: Ayoub Zaki <ayoub.zaki@embexus.com>
---
 ipc/progress_ipc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Stefano Babic May 25, 2020, 8:21 a.m. UTC | #1
On 24.05.20 19:53, Ayoub Zaki wrote:
> Signed-off-by: Ayoub Zaki <ayoub.zaki@embexus.com>
> ---
>  ipc/progress_ipc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/ipc/progress_ipc.c b/ipc/progress_ipc.c
> index b4af883..110d6b3 100644
> --- a/ipc/progress_ipc.c
> +++ b/ipc/progress_ipc.c
> @@ -56,7 +56,8 @@ static int _progress_ipc_connect(const char *socketpath, bool reconnect)
>  		}
>  		if (!reconnect) {
>  			fprintf(stderr, "cannot communicate with SWUpdate via %s\n", socketpath);
> -			exit(1);
> +			close(fd);
> +			return -1;
>  		}
>  
>  		usleep(10000);
> 

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

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/ipc/progress_ipc.c b/ipc/progress_ipc.c
index b4af883..110d6b3 100644
--- a/ipc/progress_ipc.c
+++ b/ipc/progress_ipc.c
@@ -56,7 +56,8 @@  static int _progress_ipc_connect(const char *socketpath, bool reconnect)
 		}
 		if (!reconnect) {
 			fprintf(stderr, "cannot communicate with SWUpdate via %s\n", socketpath);
-			exit(1);
+			close(fd);
+			return -1;
 		}
 
 		usleep(10000);