X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=daemon.c;h=91b96569cd75c77cd4ee169c55be045daccf3908;hb=562051809589574576971c53c23aad93f8c395d9;hp=d788167ae0bbce0995329e0263e7082513087441;hpb=ce335fe04f32261e0204280281989ffbb5d990c6;p=git.git diff --git a/daemon.c b/daemon.c index d788167a..91b96569 100644 --- a/daemon.c +++ b/daemon.c @@ -466,8 +466,14 @@ static int socksetup(int port, int **socklist_p) return 0; } + if (listen(sockfd, 5) < 0) { + close(sockfd); + return 0; + } + *socklist_p = xmalloc(sizeof(int)); **socklist_p = sockfd; + return 1; } #endif