Skip to contentSkip to conversation

git-daemon not listening when compiled with -DNO_IPV6

PATCH New Paul Serice 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 git-daemon not listening when compiled with -DNO_IPV6

git-daemon was not listening when compiled with -DNO_IPV6. socksetup() was not returning socket count when compiled with -DNO_IPV6.

---

 daemon.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

applies-to: 339319e60db7b3f96f8c711407b135a54da7aa2e bb8968537a35a635c6f8a6393cff8735b4edcef9

daemon.c +6 -0
index 2b81152..e889596 100644
@@ -510,8 +510,14 @@ static int socksetup(int port, int **soc
 		return 0;
 	}
 
+	if (listen(sockfd, 5) < 0) {
+		close(sockfd);
+		return 0;
+	}
+
 	*socklist_p = xmalloc(sizeof(int));
 	**socklist_p = sockfd;
+	return 1;
 }
 
 #endif

---
0.99.9i