summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Holman <dholman@gymli.org>2023-07-25 12:46:08 -0500
committerDanny Holman <dholman@gymli.org>2023-07-25 12:46:08 -0500
commitee0f0f95d6972e66c56812e0e3abe9275d5f0fdc (patch)
tree32af37b710cc9e4e868e4394660e9fa65934ea9a
parent9761d54f75ea632a05a37c56f59d33f5b8459688 (diff)
server: session: fix a session counting bug
Fix a bug in the num_sessions function in which the current active session would not be counted. Signed-off-by: Danny Holman <dholman@gymli.org>
-rw-r--r--server/src/session.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/server/src/session.c b/server/src/session.c
index cc7d98c..d068d38 100644
--- a/server/src/session.c
+++ b/server/src/session.c
@@ -60,7 +60,7 @@ int num_alive_sessions(void) {
struct list_head *temp = sessions.next;
while (temp != NULL) {
- if (container_of(temp, struct session, list)->alive == 1)
+ if (container_of(temp, struct session, list)->alive != 0)
ret++;
temp = temp->next;
}