Rename server_is_running() to server_is_usable()

The previous name was misleading. The new server_is_running() only
checks for the running bit so that a server is always either running
or down.
This commit is contained in:
Esa Korhonen
2018-07-27 13:20:47 +03:00
parent 89dfc80f86
commit 1e33ab69f2
11 changed files with 51 additions and 23 deletions

View File

@ -205,16 +205,32 @@ inline bool server_is_active(const SERVER* server)
return server->is_active;
}
inline bool status_is_running(uint64_t status)
inline bool status_is_usable(uint64_t status)
{
return (status & (SERVER_RUNNING | SERVER_MAINT)) == SERVER_RUNNING;
}
/**
* Is the server running and not in maintenance?
*
* @param server The server
* @return True, if server can be used.
*/
inline bool server_is_usable(const SERVER* server)
{
return status_is_usable(server->status);
}
inline bool status_is_running(uint64_t status)
{
return (status & SERVER_RUNNING);
}
/**
* Is the server running?
*
* @param server The server
* @return True, if monitor can connect to server.
* @return True, if monitor can connect to the server.
*/
inline bool server_is_running(const SERVER* server)
{