aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-09-06 15:31:55 +0200
committerEric Wong <normalperson@yhbt.net>2008-09-09 02:23:43 -0700
commit2c0e478e371d14df47d7a7f31515bbd1091f5b6a (patch)
tree6feb26753e3098713e3740a333a60132f6cdc751
parente82e9cd8b2bebbaf096bf3a091d3ea0e9613797b (diff)
downloadmpd-2c0e478e371d14df47d7a7f31515bbd1091f5b6a.tar.gz
mpd-2c0e478e371d14df47d7a7f31515bbd1091f5b6a.tar.xz
mpd-2c0e478e371d14df47d7a7f31515bbd1091f5b6a.zip
client: don't check FD_ISSET(client->fd) on expired client
client->fd becomes -1 when the client expires. Don't use FD_ISSET() with this expired client; doing so would cause a crash due to SIGBUS.
-rw-r--r--src/client.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client.c b/src/client.c
index 6bda52bd5..d04cac31f 100644
--- a/src/client.c
+++ b/src/client.c
@@ -536,7 +536,8 @@ int client_manager_io(void)
}
client->lastTime = time(NULL);
}
- if (FD_ISSET(client->fd, &wfds)) {
+ if (!client_is_expired(client) &&
+ FD_ISSET(client->fd, &wfds)) {
client_write_deferred(client);
client->lastTime = time(NULL);
}