From ee0f0f95d6972e66c56812e0e3abe9275d5f0fdc Mon Sep 17 00:00:00 2001 From: Danny Holman Date: Tue, 25 Jul 2023 12:46:08 -0500 Subject: 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 --- server/src/session.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit v1.2.3