summaryrefslogtreecommitdiff
path: root/server/server.c
diff options
context:
space:
mode:
authorGravatar Karl Ramm <kcr@mit.edu>2007-07-20 05:07:19 +0000
committerGravatar Karl Ramm <kcr@mit.edu>2007-07-20 05:07:19 +0000
commit15cf157d47aafe49fd59b7acc23fe172f8a23566 (patch)
tree747829bb544497cad68906bb21b2fd9fbb2cc1f3 /server/server.c
parent82ea504def6eb144c2b13b315890b297e29345c5 (diff)
debian patch applied and reconciled, version unfinalized
Diffstat (limited to 'server/server.c')
-rw-r--r--server/server.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/server/server.c b/server/server.c
index 377d397..5cce0ff 100644
--- a/server/server.c
+++ b/server/server.c
@@ -92,10 +92,8 @@ static Code_t server_register();
#endif
static struct in_addr *get_server_addrs __P((int *number));
-#ifndef HAVE_HESIOD
static char **get_server_list __P((char *file));
static void free_server_list __P((char **list));
-#endif
static Unacked *srv_nacktab[SRV_NACKTAB_HASHSIZE];
Server *otherservers; /* points to an array of the known
@@ -981,22 +979,21 @@ get_server_addrs(number)
int *number; /* RETURN */
{
int i;
- char **server_hosts;
+ char **server_hosts = NULL;
+ char **server_hosts_free = NULL;
char **cpp;
struct in_addr *addrs;
struct in_addr *addr;
struct hostent *hp;
+ server_hosts = get_server_list(list_file);
+ server_hosts_free = server_hosts;
#ifdef HAVE_HESIOD
- /* get the names from Hesiod */
- server_hosts = hes_resolve("zephyr","sloc");
if (!server_hosts)
- return NULL;
-#else
- server_hosts = get_server_list(list_file);
+ server_hosts = hes_resolve("zephyr","sloc");
+#endif
if (!server_hosts)
return NULL;
-#endif
/* count up */
i = 0;
for (cpp = server_hosts; *cpp; cpp++)
@@ -1015,14 +1012,11 @@ get_server_addrs(number)
}
}
*number = i;
-#ifndef HAVE_HESIOD
- free_server_list(server_hosts);
-#endif
+ if (server_hosts_free)
+ free_server_list(server_hosts_free);
return addrs;
}
-#ifndef HAVE_HESIOD
-
static int nhosts = 0;
/*
@@ -1090,7 +1084,6 @@ free_server_list(list)
free(orig_list);
return;
}
-#endif
/*
* initialize the server structure for address addr, and set a timer