MXS-1249: Return service version
Since it is now a single value, the service version can be returned as a return value instead of via an out-argument. More convenient to use that way.
This commit is contained in:
parent
dcfe118457
commit
33fe89772a
@ -374,10 +374,9 @@ typedef enum service_version_which_t
|
||||
*
|
||||
* @param service The service.
|
||||
* @param which Which version.
|
||||
* @param version On output contains the version of the service.
|
||||
*
|
||||
* @return The version of the service.
|
||||
*/
|
||||
void service_get_version(const SERVICE *service,
|
||||
service_version_which_t which,
|
||||
uint64_t* version);
|
||||
uint64_t service_get_version(const SERVICE *service, service_version_which_t which);
|
||||
|
||||
MXS_END_DECLS
|
||||
|
@ -2674,10 +2674,10 @@ json_t* service_relations_to_server(const SERVER* server, const char* host)
|
||||
return rel;
|
||||
}
|
||||
|
||||
void service_get_version(const SERVICE *service,
|
||||
service_version_which_t which,
|
||||
uint64_t* version)
|
||||
uint64_t service_get_version(const SERVICE *service, service_version_which_t which)
|
||||
{
|
||||
uint64_t version = 0;
|
||||
|
||||
if (which == SERVICE_VERSION_ANY)
|
||||
{
|
||||
SERVER_REF* sref = service->dbref;
|
||||
@ -2689,11 +2689,7 @@ void service_get_version(const SERVICE *service,
|
||||
|
||||
if (sref)
|
||||
{
|
||||
*version = server_get_version(sref->server);
|
||||
}
|
||||
else
|
||||
{
|
||||
*version = 0;
|
||||
version = server_get_version(sref->server);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -2750,6 +2746,8 @@ void service_get_version(const SERVICE *service,
|
||||
v = 0;
|
||||
}
|
||||
|
||||
*version = v;
|
||||
version = v;
|
||||
}
|
||||
|
||||
return version;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user