Blob Blame History Raw
From: Prarit Bhargava <prarit@redhat.com>

fix: server does not start because it assumed it is already running

commit 1bd29846db20a76ec7492dd54716a11976a5d9fb
Author: Balázs Póka <poka@idata.hu>
Date:   Sat Aug 22 14:06:14 2015 +0200

    fix: server does not start because it assumed it is already running

diff --git a/server.c b/server.c
index a1fa7da16ba79663bdf2f4542d0b82fdd2a786b9..eddf147a527e721419b752ea56577ee36c85056a 100644
--- a/server.c
+++ b/server.c
@@ -297,9 +297,9 @@ static int server_ping(struct sockaddr_un *un)
 	if (fd < 0)
 		return 0;
 
-	sigaction(SIGALRM, &sa, &oldsa);	
+	sigaction(SIGALRM, &sa, &oldsa);
 	if (sigsetjmp(ping_timeout_ctx, 1) == 0) {
-		ret = 0;
+		ret = -1;
 		alarm(initial_ping_timeout);
 		if (connect(fd, un, sizeof(struct sockaddr_un)) < 0)
 			goto cleanup;
@@ -315,7 +315,7 @@ cleanup:
 	sigaction(SIGALRM, &oldsa, NULL);
 	alarm(0);
 	close(fd);
-	return ret;	
+	return ret;
 }
 
 void server_setup(void)