diff options
author | Alasdair G Kergon <agk@redhat.com> | 2017-07-06 14:53:10 +0100 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2017-07-06 14:53:10 +0100 |
commit | fdd00ecdd1fd51605be1b616d712a2220ced8875 (patch) | |
tree | bb53156d3f0a334e759bc2581eeea3afe24d6220 /libdaemon | |
parent | 70c340dbc25523de18195a7916f27aa37b051e43 (diff) | |
download | lvm2-fdd00ecdd1fd51605be1b616d712a2220ced8875.tar.gz |
lvmetad: Suppress accept error on clean shutdown
Also fix error message after pthread_create() error in handle_connect().
Diffstat (limited to 'libdaemon')
-rw-r--r-- | libdaemon/server/daemon-server.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c index 10cc8f747..6fdf195c7 100644 --- a/libdaemon/server/daemon-server.c +++ b/libdaemon/server/daemon-server.c @@ -491,7 +491,8 @@ static int handle_connect(daemon_state s) client.socket_fd = accept(s.socket_fd, (struct sockaddr *) &sockaddr, &sl); if (client.socket_fd < 0) { - ERROR(&s, "Failed to accept connection errno %d.", errno); + if (errno != EAGAIN || !_shutdown_requested) + ERROR(&s, "Failed to accept connection: %s.", strerror(errno)); return 0; } @@ -512,8 +513,8 @@ static int handle_connect(daemon_state s) ts->s = s; ts->client = client; - if (pthread_create(&ts->client.thread_id, NULL, _client_thread, ts)) { - ERROR(&s, "Failed to create client thread errno %d.", errno); + if ((errno = pthread_create(&ts->client.thread_id, NULL, _client_thread, ts))) { + ERROR(&s, "Failed to create client thread: %s.", strerror(errno)); return 0; } |