Merge "Fix mtce-common build error with gcc-8.2.1"
This commit is contained in:
commit
897eb75270
@ -330,12 +330,17 @@ int msgClassAddr::getAddressFromInterface(const char* interface, char* address,
|
|||||||
// is the intf hostname
|
// is the intf hostname
|
||||||
char iface_hostname[MAX_CHARS_HOSTNAME];
|
char iface_hostname[MAX_CHARS_HOSTNAME];
|
||||||
memset(iface_hostname, 0, sizeof(iface_hostname));
|
memset(iface_hostname, 0, sizeof(iface_hostname));
|
||||||
snprintf(iface_hostname, sizeof(iface_hostname),
|
int ret = snprintf(iface_hostname, sizeof(iface_hostname),
|
||||||
"%s%s", hostname,
|
"%s%s", hostname,
|
||||||
(((interface_type == CLSTR_IFACE)) ? CLUSTER_HOST_SUFFIX : ""));
|
(((interface_type == CLSTR_IFACE)) ? CLUSTER_HOST_SUFFIX : ""));
|
||||||
|
if (ret >= (int)sizeof(iface_hostname))
|
||||||
|
{
|
||||||
|
elog("%s hostname is too long ; truncated. interface_type: %d",
|
||||||
|
hostname, interface_type);
|
||||||
|
}
|
||||||
|
|
||||||
struct addrinfo *res = NULL;
|
struct addrinfo *res = NULL;
|
||||||
int ret = getaddrinfo(iface_hostname, NULL, NULL, &res);
|
ret = getaddrinfo(iface_hostname, NULL, NULL, &res);
|
||||||
if(ret)
|
if(ret)
|
||||||
{
|
{
|
||||||
elog("%s ip address resolution failed (err: %s)",
|
elog("%s ip address resolution failed (err: %s)",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user