/*
+ * $Id$
+ *
* This file contains housekeeping tasks which periodically
* need to be executed. It keeps a nice little queue...
*
- * $Id$
*/
#include "sysdep.h"
time_t now;
int session_to_kill;
- do {
- now = time(NULL);
- session_to_kill = 0;
- begin_critical_section(S_SESSION_TABLE);
- for (ccptr = ContextList; ccptr != NULL; ccptr = ccptr->next) {
- if ( (ccptr!=CC)
- && (config.c_sleeping > 0)
- && (now - (ccptr->lastcmd) > config.c_sleeping) ) {
- session_to_kill = ccptr->cs_pid;
- }
- }
- end_critical_section(S_SESSION_TABLE);
- if (session_to_kill > 0) {
- lprintf(3, "Session %d timed out. Terminating it...\n",
- session_to_kill);
- kill_session(session_to_kill);
- }
- } while(session_to_kill > 0);
+ now = time(NULL);
+ session_to_kill = 0;
+ begin_critical_section(S_SESSION_TABLE);
+ for (ccptr = ContextList; ccptr != NULL; ccptr = ccptr->next) {
+ if ( (ccptr!=CC)
+ && (config.c_sleeping > 0)
+ && (now - (ccptr->lastcmd) > config.c_sleeping) ) {
+ ccptr->kill_me = 1;
+ }
}
+ end_critical_section(S_SESSION_TABLE);
+}
tv.tv_usec = 0;
FD_ZERO(&readfds);
FD_SET(housepipe[0], &readfds);
- select(housepipe[0] + 1, &readfds, 0L, 0L, &tv);
+ select(housepipe[0] + 1, &readfds, NULL, NULL, &tv);
if (FD_ISSET(housepipe[0], &readfds)) {
did_something = 1;
}
* NOTE: this function pair should ONLY be called during startup. It is NOT
* thread safe.
*/
-void check_ref_counts_backend(struct quickroom *qrbuf) {
+void check_ref_counts_backend(struct quickroom *qrbuf, void *data) {
struct floor flbuf;
getfloor(&flbuf, qrbuf->QRfloor);
putfloor(&flbuf, a);
}
- ForEachRoom(check_ref_counts_backend);
+ ForEachRoom(check_ref_counts_backend, NULL);
}