From 2b79854f068c99b2881a02371b4bc7dd00a4e5aa Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 17 Jan 2003 06:34:22 +0000 Subject: Fix reference count bug where smbd's would not terminate with no open resources. Jeremy. (This used to be commit b7e5a2c5474e9edd8fa783462af8986b6bd426a5) --- source3/smbd/conn.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'source3/smbd') diff --git a/source3/smbd/conn.c b/source3/smbd/conn.c index 22407348e8..c771f1254b 100644 --- a/source3/smbd/conn.c +++ b/source3/smbd/conn.c @@ -136,10 +136,12 @@ void conn_close_all(void) } /**************************************************************************** -idle inactive connections + Idle inactive connections. ****************************************************************************/ + BOOL conn_idle_all(time_t t, int deadtime) { + pipes_struct *plist = NULL; BOOL allidle = True; connection_struct *conn, *next; @@ -154,6 +156,15 @@ BOOL conn_idle_all(time_t t, int deadtime) allidle = False; } + /* + * Check all pipes for any open handles. We cannot + * idle with a handle open. + */ + + for (plist = get_first_internal_pipe(); plist; plist = get_next_internal_pipe(plist)) + if (plist->pipe_handles && plist->pipe_handles->count) + allidle = False; + return allidle; } -- cgit