s3:smbd: add connections_snum_used()
[kai/samba.git] / source3 / smbd / connection.c
index 5da2b08faab2a1f507217c8f40c725a43484cfce..5a9f4071b4f700fc5b9c80c8fcb2ea25beebbbe1 100644 (file)
@@ -130,6 +130,18 @@ int count_current_connections( const char *sharename, bool clear  )
        return cs.curr_connections;
 }
 
+bool connections_snum_used(struct smbd_server_connection *unused, int snum)
+{
+       int active;
+
+       active = count_current_connections(lp_servicename(snum), true);
+       if (active > 0) {
+               return true;
+       }
+
+       return false;
+}
+
 /****************************************************************************
  Claim an entry in the connections database.
 ****************************************************************************/