]> andersk Git - moira.git/blobdiff - clients/moira/utils.c
get the servername to use when reconnecting from the global set by main
[moira.git] / clients / moira / utils.c
index f459f8f0dfcb9d928e8bbc1729ec8b17535e1d46..2ef9735643f1d99797c63b9d23938e959bad79e8 100644 (file)
@@ -22,6 +22,7 @@
 #include <stdio.h>
 #include <strings.h>
 #include <sms.h>
+#include <sms_app.h>
 #include <menu.h>
 #include <ctype.h>
 
@@ -29,7 +30,6 @@
 #include "defs.h"
 #include "f_defs.h"
 #include "globals.h"
-#include "infodefs.h"
 
 #include <netdb.h>             /* for gethostbyname. */
 
@@ -584,25 +584,6 @@ char **  current;
     return(SUB_NORMAL);
 }
 
-/*     Function Name: CanonicalizeHostname
- *     Description: This function takes a machine name and canonicalize's it.
- *     Arguments: machine - name of the machine to work on.
- *     Returns: new name or NULL if nameserver returns error
- */
-
-char *
-CanonicalizeHostname(machine)
-char *machine;
-{
-    struct hostent *hostinfo;
-
-    hostinfo = gethostbyname(machine);
-/* If this fails then we just return what we were passed. */
-    if (hostinfo != (struct hostent *) NULL)
-       machine = hostinfo->h_name;
-    return (machine);
-}
-
 /*     Function Name: Strsave
  *     Description: save a string.
  *     Arguments: string  - the string to save.
@@ -744,6 +725,7 @@ char * query_string;
     Bool one_item;
     char temp_buf[BUFSIZ], *name;
 
+    elem = QueueTop(elem);
     one_item = (QueueCount(elem) == 1);
     while (elem != NULL) {
        char **info = (char **) elem->q_data;
@@ -908,12 +890,12 @@ int (*proc)();
 char *hint;
 {
     int status;
-    extern char *whoami;
+    extern char *whoami, *moira_server;
 
     status = sms_query(name, argc, argv, proc, hint);
     if (status != SMS_ABORTED && status != SMS_NOT_CONNECTED)
       return(status);
-    status = sms_connect();
+    status = sms_connect(moira_server);
     if (status) {
        com_err(whoami, status, " while re-connecting to server");
        return(SMS_ABORTED);
This page took 0.161158 seconds and 4 git commands to generate.