pipes_struct *get_first_internal_pipe(void);
pipes_struct *get_next_internal_pipe(pipes_struct *p);
+bool check_open_pipes(void);
bool fsp_is_np(struct files_struct *fsp);
struct tsocket_address;
return;
}
+bool check_open_pipes(void)
+{
+ pipes_struct *p;
+
+ for (p = InternalPipes; p != NULL; p = p->next) {
+ if (num_pipe_handles(p) != 0) {
+ return true;
+ }
+ }
+ return false;
+}
+
/****************************************************************************
Close an rpc pipe.
****************************************************************************/
bool conn_idle_all(struct smbd_server_connection *sconn,time_t t)
{
int deadtime = lp_deadtime()*60;
- pipes_struct *plist = NULL;
connection_struct *conn;
if (deadtime <= 0)
* 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 (num_pipe_handles(plist->pipe_handles) != 0) {
- return False;
- }
+ if (check_open_pipes()) {
+ return False;
}
-
+
return True;
}