strlcpy restricted to array length.
[openafs.git] / src / scout / scout.c
index 31a9890..e474662 100644 (file)
@@ -15,6 +15,7 @@
 #include <afs/param.h>
 
 #include <roken.h>
+#include <opr/softsig.h>
 
 #undef IN
 #include <afs/gtxwindows.h>            /*Generic window package */
 #include <afs/fsprobe.h>               /*Interface for fsprobe module */
 #include <afs/afsutil.h>
 
+#include <string.h>
+
 /*
  * Command line parameter indicies.
  */
 #define P_SERVER    0
 #define P_BASE     1
-#if 0
-#define        P_PACKAGE   2
-#endif /* 0 */
 #define P_FREQ     2
 #define P_HOST     3
 #define P_ATTENTION 4
@@ -268,7 +268,6 @@ mini_initLightObject(char *a_name, int a_x, int a_y, int a_width, struct gwin *a
     struct onode *newlightp;   /*Ptr to new light onode */
     /*We only support curses right now */
     struct gator_light_crparams light_crparams;        /*Light creation params */
-    char *truncname;           /*Truncated name, if needed */
     int name_len;              /*True length of name */
 
     if (scout_debug) {
@@ -288,18 +287,14 @@ mini_initLightObject(char *a_name, int a_x, int a_y, int a_width, struct gwin *a
     if (scout_debug)
        fprintf(scout_debugfd, "[%s] Name '%s' has %d chars\n", rn, a_name,
                name_len);
-    if (name_len <= a_width)
-       sprintf(light_crparams.onode_params.cr_name, "%s", a_name);
-    else {
-       /*
-        * We need to truncate the given name, leaving a `*' at the end to
-        * show us it's been truncated.
-        */
-       truncname = light_crparams.onode_params.cr_name;
-       strncpy(truncname, a_name, a_width - 1);
-       truncname[a_width - 1] = '*';
-       truncname[a_width] = 0;
-    }
+
+    if (a_width >= sizeof(light_crparams.onode_params.cr_name))
+       a_width = sizeof(light_crparams.onode_params.cr_name) - 1;
+
+    if (strlcpy(light_crparams.onode_params.cr_name, a_name, a_width + 1) >= a_width + 1)
+       /* The name is truncated, put a '*' at the end to note */
+       light_crparams.onode_params.cr_name[a_width - 1] = '*';
+
     light_crparams.onode_params.cr_x = a_x;
     light_crparams.onode_params.cr_y = a_y;
     light_crparams.onode_params.cr_width = a_width;
@@ -397,7 +392,7 @@ scout_initDiskLightObjects(struct mini_line *a_line, struct gwin *a_win)
        curr_disk->prev = i - 1;
        curr_disk->next = i + 1;
        curr_disk->active = 0;
-       curr_disk->name = '\0';
+       curr_disk->name = "";
 
        /*
         * Bump up to the next disk structure.
@@ -1021,7 +1016,6 @@ mini_PrintDiskStats(struct mini_line *a_srvline,
 {                              /*mini_PrintDiskStats */
 
     static char rn[] = "mini_PrintDiskStats";  /*Routine name */
-    int code;                  /*Return code */
     char s[128];               /*String buffer */
     struct onode *curr_disklight;      /*Ptr to current disk light */
     struct onode *srvname_light;       /*Ptr to server name light */
@@ -1077,13 +1071,13 @@ mini_PrintDiskStats(struct mini_line *a_srvline,
                        used_disk_idx, diskdata->label);
                fflush(scout_debugfd);
            }
-           code = mini_justify(" ",    /*Src buffer */
-                               diskdata->label,        /*Dest buffer */
-                               scout_col_width[COL_DISK],      /*Dest's width */
-                               SCOUT_RIGHT_JUSTIFY,    /*Right-justify */
-                               SCOUT_LEFT_TRUNC,       /*Left-truncate */
-                               SCOUT_ISNT_LDISK);      /*Not a labeled disk */
-           code = gator_light_set(curr_disklight, 0);
+           mini_justify(" ",   /*Src buffer */
+                        diskdata->label,       /*Dest buffer */
+                        scout_col_width[COL_DISK],     /*Dest's width */
+                        SCOUT_RIGHT_JUSTIFY,   /*Right-justify */
+                        SCOUT_LEFT_TRUNC,      /*Left-truncate */
+                        SCOUT_ISNT_LDISK);     /*Not a labeled disk */
+           gator_light_set(curr_disklight, 0);
            if (a_fix_line_num) {
                curr_disklight->o_y += a_delta_line_num;
                disk_strparams = (struct gwin_strparams *)(diskdata->llrock);
@@ -1116,7 +1110,6 @@ mini_PrintDiskStats(struct mini_line *a_srvline,
      * mark all used disk objects for this server as inactive and fix
      * their line numbers if needed.
      */
-    sc_disk = a_srvline->disks;
     used_disk_idx = a_srvline->used_head;
     while (used_disk_idx != SCOUT_NIL) {
        if (scout_debug) {
@@ -1189,14 +1182,14 @@ mini_PrintDiskStats(struct mini_line *a_srvline,
                            rn, s, found_idx, diskdata->label);
                    fflush(scout_debugfd);
                }
-               code = mini_justify(s,  /*Src buffer */
-                                   diskdata->label,    /*Dest buffer */
-                                   scout_col_width[COL_DISK],  /*Dest's width */
-                                   SCOUT_LEFT_JUSTIFY, /*Left-justify */
-                                   SCOUT_LEFT_TRUNC,   /*Left-truncate */
-                                   SCOUT_IS_LDISK);    /*Labeled disk */
+               mini_justify(s, /*Src buffer */
+                            diskdata->label,   /*Dest buffer */
+                            scout_col_width[COL_DISK], /*Dest's width */
+                            SCOUT_LEFT_JUSTIFY,        /*Left-justify */
+                            SCOUT_LEFT_TRUNC,  /*Left-truncate */
+                            SCOUT_IS_LDISK);   /*Labeled disk */
 
-               code = gator_light_set(sc_disk->disk_lp, pastthreshold);
+               gator_light_set(sc_disk->disk_lp, pastthreshold);
 
            }                   /*Found disk record */
        }
@@ -1328,7 +1321,6 @@ FS_Handler(void)
     curr_probeOK = fsprobe_Results.probeOK;
     curr_line_num = curr_line->base_line;
 
-    setting = 0;
     for (curr_srvidx = 0; curr_srvidx < scout_screen.numServers;
         curr_srvidx++) {
        /*
@@ -1353,18 +1345,18 @@ FS_Handler(void)
            sprintf(sp, "%d", curr_stats->CurrentConnections);
        } else
            sp = sblank;
-       code = mini_justify(sp, /*Src buffer */
-                           lightdata->label,   /*Dest buffer */
-                           scout_col_width[COL_CONN],  /*Dest's width */
-                           SCOUT_RIGHT_JUSTIFY,        /*Right-justify */
-                           SCOUT_LEFT_TRUNC,   /*Left-truncate */
-                           SCOUT_ISNT_LDISK);  /*Not a labeled disk */
+       mini_justify(sp,        /*Src buffer */
+                    lightdata->label,  /*Dest buffer */
+                    scout_col_width[COL_CONN], /*Dest's width */
+                    SCOUT_RIGHT_JUSTIFY,       /*Right-justify */
+                    SCOUT_LEFT_TRUNC,  /*Left-truncate */
+                    SCOUT_ISNT_LDISK); /*Not a labeled disk */
        if (scout_attn_conn != SCOUT_ATTN_NOTUSED
            && curr_stats->CurrentConnections >= scout_attn_conn)
            setting = 1;
        else
            setting = 0;
-       code = gator_light_set(curr_line->currConns_lp, setting);
+       gator_light_set(curr_line->currConns_lp, setting);
 
        lightdata = (struct gator_lightobj *)(curr_line->fetches_lp->o_data);
        if (*curr_probeOK == 0) {
@@ -1372,18 +1364,18 @@ FS_Handler(void)
            sprintf(sp, "%u", curr_stats->TotalFetchs);
        } else
            sp = sblank;
-       code = mini_justify(sp, /*Src buffer */
-                           lightdata->label,   /*Dest buffer */
-                           scout_col_width[COL_FETCH], /*Dest's width */
-                           SCOUT_RIGHT_JUSTIFY,        /*Right-justify */
-                           SCOUT_LEFT_TRUNC,   /*Left-truncate */
-                           SCOUT_ISNT_LDISK);  /*Not a labeled disk */
+       mini_justify(sp,        /*Src buffer */
+                    lightdata->label,  /*Dest buffer */
+                    scout_col_width[COL_FETCH],        /*Dest's width */
+                    SCOUT_RIGHT_JUSTIFY,       /*Right-justify */
+                    SCOUT_LEFT_TRUNC,  /*Left-truncate */
+                    SCOUT_ISNT_LDISK); /*Not a labeled disk */
        if (scout_attn_fetch != SCOUT_ATTN_NOTUSED
            && curr_stats->TotalFetchs >= scout_attn_fetch)
            setting = 1;
        else
            setting = 0;
-       code = gator_light_set(curr_line->fetches_lp, setting);
+       gator_light_set(curr_line->fetches_lp, setting);
 
        lightdata = (struct gator_lightobj *)(curr_line->stores_lp->o_data);
        if (*curr_probeOK == 0) {
@@ -1391,18 +1383,18 @@ FS_Handler(void)
            sprintf(sp, "%u", curr_stats->TotalStores);
        } else
            sp = sblank;
-       code = mini_justify(sp, /*Src buffer */
-                           lightdata->label,   /*Dest buffer */
-                           scout_col_width[COL_STORE], /*Dest's width */
-                           SCOUT_RIGHT_JUSTIFY,        /*Right-justify */
-                           SCOUT_LEFT_TRUNC,   /*Left-truncate */
-                           SCOUT_ISNT_LDISK);  /*Not a labeled disk */
+       mini_justify(sp,        /*Src buffer */
+                    lightdata->label,  /*Dest buffer */
+                    scout_col_width[COL_STORE],        /*Dest's width */
+                    SCOUT_RIGHT_JUSTIFY,       /*Right-justify */
+                    SCOUT_LEFT_TRUNC,  /*Left-truncate */
+                    SCOUT_ISNT_LDISK); /*Not a labeled disk */
        if (scout_attn_store != SCOUT_ATTN_NOTUSED
            && curr_stats->TotalStores >= scout_attn_store)
            setting = 1;
        else
            setting = 0;
-       code = gator_light_set(curr_line->stores_lp, setting);
+       gator_light_set(curr_line->stores_lp, setting);
 
        lightdata =
            (struct gator_lightobj *)(curr_line->workstations_lp->o_data);
@@ -1411,18 +1403,18 @@ FS_Handler(void)
            sprintf(sp, "%d", curr_stats->WorkStations);
        } else
            sp = sblank;
-       code = mini_justify(sp, /*Src buffer */
-                           lightdata->label,   /*Dest buffer */
-                           scout_col_width[COL_WK],    /*Dest's width */
-                           SCOUT_RIGHT_JUSTIFY,        /*Right-justify */
-                           SCOUT_LEFT_TRUNC,   /*Left-truncate */
-                           SCOUT_ISNT_LDISK);  /*Not a labeled disk */
+       mini_justify(sp,        /*Src buffer */
+                    lightdata->label,  /*Dest buffer */
+                    scout_col_width[COL_WK],   /*Dest's width */
+                    SCOUT_RIGHT_JUSTIFY,       /*Right-justify */
+                    SCOUT_LEFT_TRUNC,  /*Left-truncate */
+                    SCOUT_ISNT_LDISK); /*Not a labeled disk */
        if (scout_attn_workstations != SCOUT_ATTN_NOTUSED
            && curr_stats->WorkStations >= scout_attn_workstations)
            setting = 1;
        else
            setting = 0;
-       code = gator_light_set(curr_line->workstations_lp, setting);
+       gator_light_set(curr_line->workstations_lp, setting);
 
        /*
         * We turn the server light on if there was an error in the
@@ -1430,7 +1422,7 @@ FS_Handler(void)
         * (Don't forget to fix the light's line if it needs it).
         */
        setting = (*curr_probeOK) ? 1 : 0;
-       code = gator_light_set(curr_line->srvName_lp, setting);
+       gator_light_set(curr_line->srvName_lp, setting);
 
        /*
         * Print out the disk statistics.  The value returned is the
@@ -1586,7 +1578,6 @@ init_mini_line(struct sockaddr_in *a_skt, int a_lineNum,
                "[%s] Can't center server name inside of light object\n", rn);
        return (code);
     }
-    curr_x += scout_col_width[COL_SRVNAME] + 1;
 
     if (scout_initDiskLightObjects(a_line, scout_frame->window)) {
        fprintf(stderr, "[%s:%s] Can't create disk light objects\n", pn, rn);
@@ -1639,12 +1630,7 @@ execute_scout(int a_numservers, struct cmd_item *a_srvname, int a_pkg)
     struct mini_line *curr_line;       /*Ptr to current line */
     int i;                     /*Generic loop variable */
     int mini_line_bytes;       /*Num bytes in mini_lines */
-    struct timeval tv;         /*Time structure */
     int linenum;               /*Current mini-line number */
-#if 0
-    PROCESS pid;               /*Main LWP process ID */
-    PROCESS gxlistener_ID;     /*Input Server LWP process ID */
-#endif /* 0 */
     struct gator_lightobj *lightdata;  /*Private light data */
 
     if (scout_debug) {
@@ -1653,23 +1639,14 @@ execute_scout(int a_numservers, struct cmd_item *a_srvname, int a_pkg)
     }
 
     /*
-     * We have to initialize LWP support before we start up any of
+     * We have to initialize thread support before we start up any of
      * our packages.
      */
-#if 0
-    code = LWP_InitializeProcessSupport(LWP_NORMAL_PRIORITY, &pid);
-    if (code) {
-       fprintf(stderr, "[%s:%s] Can't initialize LWP\n", pn, rn);
-       scout_CleanExit(code);
-    }
-#endif /* 0 */
+    opr_softsig_Init();
 
     /*
      * Initialize the gtx package.
      */
-#if 0
-    fprintf(stderr, "[%s:%s] Starting up gtx package\n", pn, rn);
-#endif /* 0 */
     scout_gwin = gtx_Init(0,   /*Don't start up InputServer yet */
                          -1);  /*Type of window package */
     if (scout_gwin == NULL) {
@@ -1700,14 +1677,13 @@ execute_scout(int a_numservers, struct cmd_item *a_srvname, int a_pkg)
      * watching.
      */
     sktbytes = a_numservers * sizeof(struct sockaddr_in);
-    FSSktArray = (struct sockaddr_in *)malloc(sktbytes);
+    FSSktArray = calloc(1, sktbytes);
     if (FSSktArray == (struct sockaddr_in *)0) {
        fprintf(stderr,
                "[%s] Can't malloc() %d sockaddrs (%d bytes) for the given servers\n",
                rn, a_numservers, sktbytes);
        scout_CleanExit(-1);
     }
-    memset(FSSktArray, 0, sktbytes);
 
     /*
      * Sweep through the server names provided, filling in the socket
@@ -1743,13 +1719,12 @@ execute_scout(int a_numservers, struct cmd_item *a_srvname, int a_pkg)
      * Create the set of mini-lines, one per server.
      */
     mini_line_bytes = a_numservers * sizeof(struct mini_line);
-    mini_lines = (struct mini_line *)malloc(mini_line_bytes);
+    mini_lines = calloc(1, mini_line_bytes);
     if (mini_lines == (struct mini_line *)0) {
        fprintf(stderr, "[%s] Can't malloc() %d bytes for %d screen lines\n",
                rn, mini_line_bytes, a_numservers);
        return (-1);
     }
-    memset(mini_lines, 0, mini_line_bytes);
 
     /*
      * Set up each line in the mini_lines, creating and initializing
@@ -1784,11 +1759,10 @@ execute_scout(int a_numservers, struct cmd_item *a_srvname, int a_pkg)
                                            scout_gwin);        /*Window */
     if (scout_banner0_lp != NULL) {
        lightdata = (struct gator_lightobj *)(scout_banner0_lp->o_data);
-       code =
-           mini_justify(scout_Banner, lightdata->label, scout_frameDims.maxx,
-                        SCOUT_CENTER, SCOUT_RIGHT_TRUNC, SCOUT_ISNT_LDISK);
-       code = gator_light_set(scout_banner0_lp, 1);
-       code = gtxframe_AddToList(scout_frame, scout_banner0_lp);
+       mini_justify(scout_Banner, lightdata->label, scout_frameDims.maxx,
+                    SCOUT_CENTER, SCOUT_RIGHT_TRUNC, SCOUT_ISNT_LDISK);
+       gator_light_set(scout_banner0_lp, 1);
+       gtxframe_AddToList(scout_frame, scout_banner0_lp);
 
        /*Debugging */
        if (scout_debug)
@@ -1808,22 +1782,25 @@ execute_scout(int a_numservers, struct cmd_item *a_srvname, int a_pkg)
            snprintf(attn_label, sizeof(attn_label), "%s: < %d blocks free",
                     scout_label[5], scout_attn_disk_minfree);
        }
-       snprintf(scout_Banner, sizeof(scout_Banner),
-                "%*s %*s %*s %*s %*s %s",
-                scout_col_width[0], scout_label[0],
-                scout_col_width[1], scout_label[1],
-                scout_col_width[2], scout_label[2],
-                scout_col_width[3], scout_label[3],
-                scout_col_width[4], scout_label[4],
-                attn_label);
+       code = snprintf(scout_Banner, sizeof(scout_Banner),
+                       "%*s %*s %*s %*s %*s %s",
+                       scout_col_width[0], scout_label[0],
+                       scout_col_width[1], scout_label[1],
+                       scout_col_width[2], scout_label[2],
+                       scout_col_width[3], scout_label[3],
+                       scout_col_width[4], scout_label[4],
+                       attn_label);
+       if (code < 0 || code >= sizeof(scout_Banner)) {
+           fprintf(stderr, "[%s] Truncation while generating banner\n", rn);
+           return -1;
+       }
 
        lightdata = (struct gator_lightobj *)(scout_banner1_lp->o_data);
-       code =
-           mini_justify(scout_Banner, lightdata->label, scout_frameDims.maxx,
-                        SCOUT_LEFT_JUSTIFY, SCOUT_RIGHT_TRUNC,
-                        SCOUT_ISNT_LDISK);
+       mini_justify(scout_Banner, lightdata->label, scout_frameDims.maxx,
+                    SCOUT_LEFT_JUSTIFY, SCOUT_RIGHT_TRUNC,
+                    SCOUT_ISNT_LDISK);
 
-       code = gtxframe_AddToList(scout_frame, scout_banner1_lp);
+       gtxframe_AddToList(scout_frame, scout_banner1_lp);
     }
 
     scout_banner2_lp = mini_initLightObject("Banner 2",        /*Light name */
@@ -1840,11 +1817,10 @@ execute_scout(int a_numservers, struct cmd_item *a_srvname, int a_pkg)
                 scout_underline[5]);
 
        lightdata = (struct gator_lightobj *)(scout_banner2_lp->o_data);
-       code =
-           mini_justify(scout_Banner, lightdata->label,
-                        scout_frameDims.maxx, SCOUT_LEFT_JUSTIFY,
-                        SCOUT_RIGHT_TRUNC, SCOUT_ISNT_LDISK);
-       code = gtxframe_AddToList(scout_frame, scout_banner2_lp);
+       mini_justify(scout_Banner, lightdata->label,
+                    scout_frameDims.maxx, SCOUT_LEFT_JUSTIFY,
+                    SCOUT_RIGHT_TRUNC, SCOUT_ISNT_LDISK);
+       gtxframe_AddToList(scout_frame, scout_banner2_lp);
     }
 
     for (i = 0; i < a_numservers; i++) {
@@ -1912,21 +1888,6 @@ execute_scout(int a_numservers, struct cmd_item *a_srvname, int a_pkg)
 
     }                          /*Add lights in server records to display list */
 
-#if 0
-    /*
-     * Set up the minimal keymap.
-     */
-    code = keymap_BindToString(scout_frame->keymap,    /*Ptr to keymap */
-                              "e",     /*Key to bind */
-                              ExitCmd, /*Cmd to execute */
-                              NULL,    /*Name */
-                              NULL);   /*Ptr to rock */
-    if (code) {
-       fprintf(stderr, "[%s] Can't bind key `e', code is %d\n", rn, code);
-       return (code);
-    }
-#endif /* 0 */
-
     /*
      * Finish setting up the overall mini_screen structure.
      */
@@ -1945,28 +1906,12 @@ execute_scout(int a_numservers, struct cmd_item *a_srvname, int a_pkg)
                        scout_probefreq,        /*Probe frequency */
                        FS_Handler,     /*Handler routine */
                        0);     /*Turn debugging output off */
-#if 0
-    scout_debug);              /*Turn debugging output off */
-#endif /* 0 */
     if (code) {
        fprintf(stderr, "[%s] Error returned by fsprobe_Init: %d\n", rn,
                code);
        return (-1);
     }
 
-
-    /*
-     * Start up the input server LWP for our window.
-     */
-#if 0
-    code = LWP_CreateProcess(gtx_InputServer,  /*Fcn to start up */
-                            8192,      /*Stack size in bytes */
-                            LWP_NORMAL_PRIORITY,       /*Priority */
-                            (void *)scout_gwin,        /*Params: Ptr to window */
-                            "gx-listener",     /*Name to use */
-                            &gxlistener_ID);   /*Returned LWP process ID */
-#endif /* 0 */
-
     code = (int)(intptr_t)gtx_InputServer(scout_gwin);
     if (code) {
        fprintf(stderr,
@@ -1975,28 +1920,8 @@ execute_scout(int a_numservers, struct cmd_item *a_srvname, int a_pkg)
        scout_CleanExit(code);
     }
 
-    /*
-     * We fall into a loop, sleeping forever.
-     */
-    while (1) {
-       tv.tv_sec = 60 * 60;    /*Sleep for an hour at a time */
-       tv.tv_usec = 0;
-       code = select(0,        /*Num fds */
-                     0,        /*Descriptors ready for reading */
-                     0,        /*Descriptors ready for writing */
-                     0,        /*Descriptors with exceptional conditions */
-                     &tv);     /*Timeout structure */
-    }                          /*Sleep forever */
-
-#if 0
-    /*
-     * How did we get here?  Oh, well, clean up our windows and
-     * return sweetness and light anyway.
-     */
-    WOP_CLEANUP(&scout_gwin);
-    return (0);
-#endif /* 0 */
-
+    fsprobe_Wait(0); /* sleep forever */
+    return 0;
 }                              /*execute_scout */
 
 /*------------------------------------------------------------------------
@@ -2253,29 +2178,7 @@ static int scoutInit(struct cmd_syndesc *as, void *arock)
        fprintf(scout_debugfd, "[%s] Writing to Scout debugging file '%s'\n",
                rn, debug_filename);
     }
-#if 0
-    wpkg_to_use = atoi(as->parms[P_PACKAGE].items->data);
-#endif /* 0 */
     wpkg_to_use = 2;           /*Always use curses for now */
-#if 0
-    fprintf(stderr, "[%s:%s] Using graphics package %d: ", pn, rn,
-           wpkg_to_use);
-    switch (wpkg_to_use) {
-    case GATOR_WIN_CURSES:
-       fprintf(stderr, "curses\n");
-       break;
-    case GATOR_WIN_DUMB:
-       fprintf(stderr, "dumb terminal\n");
-       break;
-    case GATOR_WIN_X11:
-       fprintf(stderr, "X11\n");
-       break;
-    default:
-       fprintf(stderr, "Illegal graphics package: %d\n", wpkg_to_use);
-       scout_CleanExit(-1);
-    }                          /*end switch (wpkg_to_use) */
-#endif /* 0 */
-
     if (as->parms[P_FREQ].items != 0)
        scout_probefreq = atoi(as->parms[P_FREQ].items->data);
     else
@@ -2365,15 +2268,11 @@ main(int argc, char **argv)
     /*
      * Set up the commands we understand.
      */
-    ts = cmd_CreateSyntax("initcmd", scoutInit, NULL, "initialize the program");
+    ts = cmd_CreateSyntax("initcmd", scoutInit, NULL, 0, "initialize the program");
     cmd_AddParm(ts, "-server", CMD_LIST, CMD_REQUIRED,
                "FileServer name(s) to monitor");
     cmd_AddParm(ts, "-basename", CMD_SINGLE, CMD_OPTIONAL,
                "base server name");
-#if 0
-    cmd_AddParm(ts, "-package", CMD_SINGLE, CMD_REQUIRED,
-               "Graphics package to use");
-#endif /* 0 */
     cmd_AddParm(ts, "-frequency", CMD_SINGLE, CMD_OPTIONAL,
                "poll frequency, in seconds");
     cmd_AddParm(ts, "-host", CMD_FLAG, CMD_OPTIONAL,
@@ -2391,10 +2290,6 @@ main(int argc, char **argv)
      */
     code = cmd_Dispatch(argc, argv);
     if (code) {
-#if 0
-       fprintf(stderr, "[%s:%s] Call to cmd_Dispatch() failed; code is %d\n",
-               pn, rn, code);
-#endif /* 0 */
        scout_CleanExit(1);
     } else
        scout_CleanExit(0);