about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-06-21 03:34:27 +0000
committerEric Wong <normalperson@yhbt.net>2013-06-25 21:34:09 +0000
commit40f84cd0924958c619d434a9147e7ed2b6abaadc (patch)
treed29f1afb046d27f1308294e772d226cc06e0d8c6
parent9f43d3eb8cf6a156108c714551a7eb68472e17a4 (diff)
downloadcmogstored-40f84cd0924958c619d434a9147e7ed2b6abaadc.tar.gz
A client may disconnect at any time, so shutdown may fail harmlessly
with ENOTCONN.
-rw-r--r--fdmap.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fdmap.c b/fdmap.c
index 8cb9954..823cf9f 100644
--- a/fdmap.c
+++ b/fdmap.c
@@ -230,8 +230,9 @@ static size_t expire_http(struct mog_fd *mfd, uint32_t msec)
                     tcp_timedout(&info, msec)) {
                         if (shutdown(mfd->fd, SHUT_RDWR) == 0)
                                 return 1;
-
-                        syslog(LOG_WARNING, "BUG? expire_http,shutdown: %m");
+                        if (errno != ENOTCONN)
+                                syslog(LOG_WARNING,
+                                       "BUG? expire_http,shutdown: %m");
                 }
         } else {
                 assert(errno != EINVAL && "BUG: getsockopt: EINVAL");