Ignore:
Timestamp:
Oct 26, 2007, 12:20:10 AM (17 years ago)
Author:
rainer
Message:

More thread-safety changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_portcheck.c

    r132 r134  
    835835    }
    836836           
     837  SH_MUTEX_LOCK(mutex_resolv);
    837838  hent = gethostbyname(portchk_hostname);
    838839
     
    840841    {
    841842      memcpy (&(iface_list.iface[iface_list.used].s_addr), hent->h_addr_list[i], sizeof(in_addr_t));
     843      ++iface_list.used;
     844      ++i;
     845    }
     846  SH_MUTEX_UNLOCK(mutex_resolv);
     847
     848  for (i = 0; i < iface_list.used; ++i)
     849    {
    842850      sl_snprintf(errbuf, sizeof(errbuf), _("interface: %s"),
    843                   inet_ntoa(iface_list.iface[iface_list.used]));
     851                  inet_ntoa(iface_list.iface[i]));
    844852      sh_error_handle(SH_ERR_INFO, FIL__, __LINE__, 0, MSG_E_SUBGEN,
    845853                      errbuf, _("sh_portchk_init"));
    846 
    847       ++iface_list.used;
    848       ++i;
    849854    }
    850855
     
    14421447  sh_portchk_check();
    14431448
    1444   /*
    1445   sleep(10);
    1446 
    1447   sh_portchk_check();
    1448   */
    1449 
    14501449  return 0;
    14511450}
Note: See TracChangeset for help on using the changeset viewer.