summaryrefslogtreecommitdiffstats
path: root/libdaemon
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2012-07-19 16:45:08 +0200
committerPeter Rajnoha <prajnoha@redhat.com>2012-07-19 16:45:08 +0200
commit8d5ae472e5226f87175d51722fb5942c531bb8bb (patch)
tree2132836179820c1c49f2dff45cb6a5edc267030e /libdaemon
parent48367c5be9b39cd118caeb6b8e554be347d2fd8c (diff)
downloadlvm2-8d5ae472e5226f87175d51722fb5942c531bb8bb.tar.gz
lvm2-8d5ae472e5226f87175d51722fb5942c531bb8bb.tar.xz
lvm2-8d5ae472e5226f87175d51722fb5942c531bb8bb.zip
daemon-server: fix error message on daemon shutdown
If a daemon (like lvmetad that is using common daemon-server code) received a kill signal that was supposed to shut the daemon down, a spurious message was issued: "Failed to handle a client connection". This happened if the kill signal came just in the middle of waiting for a client request in "select" - the request that was supposed to be handled was blank at that moment of course.
Diffstat (limited to 'libdaemon')
-rw-r--r--libdaemon/server/daemon-server.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
index 65b28e46..5ca92316 100644
--- a/libdaemon/server/daemon-server.c
+++ b/libdaemon/server/daemon-server.c
@@ -510,7 +510,7 @@ void daemon_start(daemon_state s)
if (select(FD_SETSIZE, &in, NULL, NULL, NULL) < 0 && errno != EINTR)
perror("select error");
if (FD_ISSET(s.socket_fd, &in))
- if (!handle_connect(s))
+ if (!_shutdown_requested && !handle_connect(s))
syslog(LOG_ERR, "Failed to handle a client connection.");
}