Fix compile warning on Fedora 42.
authorBo Peng <pengbo@sraoss.co.jp>
Mon, 1 Sep 2025 02:28:47 +0000 (11:28 +0900)
committerBo Peng <pengbo@sraoss.co.jp>
Mon, 1 Sep 2025 02:28:47 +0000 (11:28 +0900)
src/watchdog/wd_heartbeat.c

index acececc1ad9034842dedb9e02a0188df911b5a82..5d08abec0246454e5cb6013bdcca6bf86ef5cff4 100644 (file)
@@ -270,7 +270,7 @@ wd_create_hb_recv_socket(WdHbIf *hb_if)
        hints.ai_protocol = 0;
        hints.ai_flags = AI_NUMERICSERV | AI_PASSIVE;
 
-       if ((gai_ret = getaddrinfo(!hb_if->addr ? NULL : hb_if->addr, portstr, &hints, &res)) != 0)
+       if ((gai_ret = getaddrinfo(hb_if->addr[0] == '\0' ? NULL : hb_if->addr, portstr, &hints, &res)) != 0)
        {
                ereport(WARNING,
                                (errmsg("getaddrinfo() failed with error \"%s\"", gai_strerror(gai_ret))));