|
@@ -72,19 +72,18 @@ long int gethostid(void)
|
|
|
if (gethostname(host,MAXHOSTNAMELEN)>=0 && *host) {
|
|
|
struct hostent *hp;
|
|
|
struct in_addr in;
|
|
|
+ struct hostent ghbn_h;
|
|
|
+ char ghbn_buf[sizeof(struct in_addr) +
|
|
|
+ sizeof(struct in_addr *)*2 +
|
|
|
+ sizeof(char *)*((2 + 5 +
|
|
|
+ 1)) +
|
|
|
+ 256 + 32];
|
|
|
+ int ghbn_errno;
|
|
|
|
|
|
|
|
|
|
|
|
- {
|
|
|
- struct hostent ghbn_h;
|
|
|
- char ghbn_buf[sizeof(struct in_addr) +
|
|
|
- sizeof(struct in_addr *)*2 +
|
|
|
- sizeof(char *)*((2 + 5 +
|
|
|
- 1)) +
|
|
|
- 256 + 32];
|
|
|
- int ghbn_errno;
|
|
|
- gethostbyname_r(host, &ghbn_h, ghbn_buf, sizeof(ghbn_buf), &hp, &ghbn_errno);
|
|
|
- }
|
|
|
+ gethostbyname_r(host, &ghbn_h, ghbn_buf, sizeof(ghbn_buf), &hp, &ghbn_errno);
|
|
|
+
|
|
|
if (hp == (struct hostent *)NULL)
|
|
|
|
|
|
|