diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-07-28 19:34:43 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-07-28 19:34:43 +0200 |
commit | b48dfd86c90cae3f98dca01101b7e298c0192d16 (patch) | |
tree | 4e2ab2b9811d0fc44449153e0034ae8897a80797 /daemon.c | |
parent | Merge branch 'nd/pack-ofs-4gb-limit' (diff) | |
parent | Windows: add missing definition of ENOTSOCK (diff) | |
download | git-b48dfd86c90cae3f98dca01101b7e298c0192d16.tar.xz git-b48dfd86c90cae3f98dca01101b7e298c0192d16.zip |
Merge branch 'ew/daemon-socket-keepalive'
Recent update to "git daemon" tries to enable the socket-level
KEEPALIVE, but when it is spawned via inetd, the standard input
file descriptor may not necessarily be connected to a socket.
Suppress an ENOTSOCK error from setsockopt().
* ew/daemon-socket-keepalive:
Windows: add missing definition of ENOTSOCK
daemon: ignore ENOTSOCK from setsockopt
Diffstat (limited to 'daemon.c')
-rw-r--r-- | daemon.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -672,9 +672,11 @@ static void set_keep_alive(int sockfd) { int ka = 1; - if (setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, &ka, sizeof(ka)) < 0) - logerror("unable to set SO_KEEPALIVE on socket: %s", - strerror(errno)); + if (setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, &ka, sizeof(ka)) < 0) { + if (errno != ENOTSOCK) + logerror("unable to set SO_KEEPALIVE on socket: %s", + strerror(errno)); + } } static int execute(void) |