aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeebs <seebs@seebs.net>2018-02-16 11:49:49 -0600
committerSeebs <seebs@seebs.net>2018-02-16 11:49:49 -0600
commit26e30fa2e1a0fe4e885d7eea3f55d23cd2c3158f (patch)
treebc7f3f216c7ad95e67af933e1b98e77b3b5f5fd9
parentb6a015aa91d7ab84c2f5466f3b5704f501129cbc (diff)
downloadpseudo-26e30fa2e1a0fe4e885d7eea3f55d23cd2c3158f.tar.gz
pseudo-26e30fa2e1a0fe4e885d7eea3f55d23cd2c3158f.tar.bz2
pseudo-26e30fa2e1a0fe4e885d7eea3f55d23cd2c3158f.zip
Allow closing client 0
It seems like the epoll setup can in some cases end up with a client #0, which the code would refuse to close, so it just looped forever. Only reject negative numbers, not zero. Signed-off-by: seebs <seebs@seebs.net>
-rw-r--r--ChangeLog.txt3
-rw-r--r--pseudo_server.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt
index a6e4c79..ae27a6a 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,3 +1,6 @@
+2018-02-16:
+ * (seebs) allow closing client #0.
+
2018-02-15:
* (seebs) O_TMPFILE is actually some other flag AND O_DIRECTORYy,
so a test for (flags & O_TMPFILE) does not actually test that
diff --git a/pseudo_server.c b/pseudo_server.c
index dac3258..c12ba9b 100644
--- a/pseudo_server.c
+++ b/pseudo_server.c
@@ -449,7 +449,7 @@ close_client(int client) {
pseudo_debug(PDBGF_SERVER, "lost client %d [%d], closing fd %d\n", client,
clients[client].pid, clients[client].fd);
/* client went away... */
- if (client > highest_client || client <= 0) {
+ if (client > highest_client || client < 0) {
pseudo_diag("tried to close client %d (highest is %d)\n",
client, highest_client);
return;