Call rx_InitHost once during daemon startup
[openafs.git] / src / bozo / bosserver.c
index ddaae5d..df38bd4 100644 (file)
@@ -633,7 +633,7 @@ BozoDaemon(void *unused)
            bnode_ApplyInstance(bdrestart, 0);
        }
     }
-    return NULL;
+    AFS_UNREACHED(return(NULL));
 }
 
 #ifdef AFS_AIX32_ENV
@@ -1002,6 +1002,13 @@ main(int argc, char **argv, char **envp)
        else {
 
            /* hack to support help flag */
+           int ec;
+           if (strcmp(argv[code], "-help") == 0 || strcmp(argv[code], "-h") == 0)
+               ec = 0; /* It is not an error to ask for usage. */
+           else {
+               printf("Unrecognized option: %s\n", argv[code]);
+               ec = 1;
+           }
 
 #ifndef AFS_NT40_ENV
            printf("Usage: bosserver [-noauth] [-log] "
@@ -1028,7 +1035,7 @@ main(int argc, char **argv, char **envp)
 #endif
            fflush(stdout);
 
-           exit(0);
+           exit(ec);
        }
     }
     if (auditFileName) {
@@ -1146,11 +1153,7 @@ main(int argc, char **argv, char **envp)
        host = GetRxBindAddress();
     }
     for (i = 0; i < 10; i++) {
-       if (rxBind) {
-           code = rx_InitHost(host, htons(AFSCONF_NANNYPORT));
-       } else {
-           code = rx_Init(htons(AFSCONF_NANNYPORT));
-       }
+       code = rx_InitHost(host, htons(AFSCONF_NANNYPORT));
        if (code) {
            bozo_Log("can't initialize rx: code=%d\n", code);
            sleep(3);
@@ -1255,4 +1258,5 @@ bozo_Log(const char *format, ...)
            fclose(bozo_logFile);
        }
     }
+    va_end(ap);
 }