It turns out to be `const' under Cygwin. In fact, we don't need to
capture it at all, so restructure the logic so we don't bother trying.
if (doread(cfd, &addr, sizeof(addr)))
goto lose;
if ((h = gethostbyaddr((char *)&addr, sizeof(addr), AF_INET)) == 0)
if (doread(cfd, &addr, sizeof(addr)))
goto lose;
if ((h = gethostbyaddr((char *)&addr, sizeof(addr), AF_INET)) == 0)
/* --- Do a forward lookup to confirm --- */
{
size_t sz = strlen(h->h_name) + 1;
if ((p = malloc(sz)) == 0)
/* --- Do a forward lookup to confirm --- */
{
size_t sz = strlen(h->h_name) + 1;
if ((p = malloc(sz)) == 0)
memcpy(p, h->h_name, sz);
}
h = gethostbyname(p);
free(p);
if (!h)
memcpy(p, h->h_name, sz);
}
h = gethostbyname(p);
free(p);
if (!h)
if (h) {
char **pp;
for (pp = h->h_addr_list; *pp; pp++) {
struct in_addr a;
memcpy(&a, *pp, sizeof(a));
if (h) {
char **pp;
for (pp = h->h_addr_list; *pp; pp++) {
struct in_addr a;
memcpy(&a, *pp, sizeof(a));
- if (a.s_addr == addr.s_addr) {
- p = h->h_name;
- break;
- }
+ if (a.s_addr == addr.s_addr)
+ goto skip;
- if (!p) {
- h = 0;
- h_errno = NO_RECOVERY;
- }
- fail:;
+ h = 0;
+ h_errno = NO_RECOVERY;
+ skip:;
} break;
/* --- Unknown request -- may have lost sync --- */
} break;
/* --- Unknown request -- may have lost sync --- */