summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 958545c)
raw | patch | inline | side by side (parent: 958545c)
author | Alexandre Julliard <julliard@winehq.org> | |
Wed, 14 Feb 2007 17:10:26 +0000 (18:10 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 14 Feb 2007 18:25:41 +0000 (10:25 -0800) |
This makes it possible to restart git-daemon even if some children are
still running.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
still running.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
daemon.c | patch | blob | history |
diff --git a/daemon.c b/daemon.c
index 2a20ca55cbe912a8ddd4bea8b2476ae30215903a..66f8d6f03d91d7dfa4a164137ee0310ca26dc1aa 100644 (file)
--- a/daemon.c
+++ b/daemon.c
char pbuf[NI_MAXSERV];
struct addrinfo hints, *ai0, *ai;
int gai;
+ long flags;
sprintf(pbuf, "%d", listen_port);
memset(&hints, 0, sizeof(hints));
continue; /* not fatal */
}
+ flags = fcntl(sockfd, F_GETFD, 0);
+ if (flags >= 0)
+ fcntl(sockfd, F_SETFD, flags | FD_CLOEXEC);
+
socklist = xrealloc(socklist, sizeof(int) * (socknum + 1));
socklist[socknum++] = sockfd;
{
struct sockaddr_in sin;
int sockfd;
+ long flags;
memset(&sin, 0, sizeof sin);
sin.sin_family = AF_INET;
return 0;
}
+ flags = fcntl(sockfd, F_GETFD, 0);
+ if (flags >= 0)
+ fcntl(sockfd, F_SETFD, flags | FD_CLOEXEC);
+
*socklist_p = xmalloc(sizeof(int));
**socklist_p = sockfd;
return 1;