bozo: preserve all options over restart
[openafs.git] / src / WINNT / bosctlsvc / bosctlsvc.c
index 583dd59..0a93e6b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright 2000, International Business Machines Corporation and others.
  * All Rights Reserved.
- * 
+ *
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
@@ -16,7 +16,6 @@
 #include <afs/param.h>
 #include <afs/stds.h>
 
-#include <param.h>
 #include <stddef.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -36,7 +35,6 @@
 
 #define BOSSERVER_STARTMSG_EXE  "afslegal.exe"
 
-#define BOSSERVER_RESTART_ARG_MAX  2  /* "-noauth", "-log" */
 #define BOSSERVER_WAIT_TIME_HINT  60  /* seconds */
 #define BOSSERVER_STOP_TIME_MAX  (FSSDTIME + 60)  /* seconds */
 
@@ -77,7 +75,6 @@ static void BosserverDoStopEvent(pid_t cpid,
 static void BosserverDoExitEvent(pid_t cpid,
                                 BOOL *doWait,
                                 BOOL *doRestart,
-                                char **restartArgv,
                                 DWORD *stopStatus,
                                 BOOL *isWin32Code);
 
@@ -383,7 +380,6 @@ static void
 BosserverDoExitEvent(pid_t cpid,
                     BOOL *doWait,
                     BOOL *doRestart,
-                    char **restartArgv,
                     DWORD *stopStatus,
                     BOOL *isWin32Code)
 {
@@ -403,22 +399,6 @@ BosserverDoExitEvent(pid_t cpid,
                /* bosserver requests restart */
                int i;
                *doRestart = TRUE;
-
-               /* set up bosserver argument list */
-               restartArgv[0] = (char *)AFSDIR_SERVER_BOSVR_FILEPATH;
-               i = 1;
-
-               if (exitCode & BOSEXIT_NOAUTH_FLAG) {
-                   /* pass "-noauth" to new bosserver */
-                   restartArgv[i] = "-noauth";
-                   i++;
-               }
-               if (exitCode & BOSEXIT_LOGGING_FLAG) {
-                   /* pass "-log" to new bosserver */
-                   restartArgv[i] = "-log";
-                   i++;
-               }
-               restartArgv[i] = NULL;
            }
        }
 
@@ -460,9 +440,8 @@ BosserverRun(DWORD argc,
     /* Set env variable forcing process mgmt lib to spawn processes detached */
     (void)putenv(PMGT_SPAWN_DETACHED_ENV_NAME "=1");
 
-    /* Alloc block with room for at least BOSSERVER_RESTART_ARG_MAX args */
-    i = max((argc + 1), (BOSSERVER_RESTART_ARG_MAX + 2));
-    spawn_argv = (char **)malloc(i * sizeof(char *));
+    /* Alloc block with room for arguments plus a terminator */
+    spawn_argv = (char **)malloc((argc + 1) * sizeof(char *));
 
     if (spawn_argv == NULL) {
        /* failed to malloc required space; can not continue */
@@ -532,7 +511,7 @@ BosserverRun(DWORD argc,
                /* exit event signaled; see function comment for outcomes */
                BosserverDoExitEvent(cpid,
                                     &doWait,
-                                    &doRestart, spawn_argv,
+                                    &doRestart,
                                     stopStatus, isWin32Code);
 
            } else {