]> asedeno.scripts.mit.edu Git - 1ts-debian.git/blobdiff - zephyr/server/server.c
This commit was manufactured by cvs2svn to create branch
[1ts-debian.git] / zephyr / server / server.c
index ec207d533e6b59da851b035ec793f3de6963f53a..9aa54fc2290c4b8003dd8c40afaa94a6b7135aee 100644 (file)
@@ -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