Merge branch '2.1' into develop

This commit is contained in:
Markus Mäkelä
2017-03-22 15:20:21 +02:00
107 changed files with 3365 additions and 3638 deletions

View File

@ -2299,3 +2299,29 @@ void service_print_users(DCB *dcb, const SERVICE *service)
}
}
}
bool service_port_is_used(unsigned short port)
{
bool rval = false;
spinlock_acquire(&service_spin);
for (SERVICE *service = allServices; service && !rval; service = service->next)
{
spinlock_acquire(&service->spin);
for (SERV_LISTENER *proto = service->ports; proto; proto = proto->next)
{
if (proto->port == port)
{
rval = true;
break;
}
}
spinlock_release(&service->spin);
}
spinlock_release(&service_spin);
return rval;
}