sin_family is not network order
[openafs.git] / src / scout / scout.c
index b17a857..9877ae1 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
@@ -220,7 +220,7 @@ static const char *scout_underline[] =
  *     Void.
  *
  * Environment:
- *     Actions depend on scout_gtx_initialized.  
+ *     Actions depend on scout_gtx_initialized.
  *
  * Side Effects:
  *     This routine will always exit Scout.
@@ -461,7 +461,7 @@ scout_initDiskLightObjects(struct mini_line *a_line, struct gwin *a_win)
  *------------------------------------------------------------------------*/
 
 int
-mini_justify(char *a_srcbuff, char *a_dstbuff, int a_dstwidth, 
+mini_justify(char *a_srcbuff, char *a_dstbuff, int a_dstwidth,
             int a_justification, int a_rightTrunc,
             int a_isLabeledDisk)
 {                              /*mini_justify */
@@ -1024,8 +1024,8 @@ scout_RemoveInactiveDisk(struct mini_line *a_srvline, int a_used_idx)
  *------------------------------------------------------------------------*/
 
 static int
-mini_PrintDiskStats(struct mini_line *a_srvline, 
-                   struct ProbeViceStatistics *a_stats, 
+mini_PrintDiskStats(struct mini_line *a_srvline,
+                   struct ProbeViceStatistics *a_stats,
                    int a_probeOK, int a_width_changed,
                    int a_fix_line_num, int a_delta_line_num)
 {                              /*mini_PrintDiskStats */
@@ -1379,7 +1379,7 @@ FS_Handler(void)
        lightdata = (struct gator_lightobj *)(curr_line->fetches_lp->o_data);
        if (*curr_probeOK == 0) {
            sp = s;
-           sprintf(sp, "%d", curr_stats->TotalFetchs);
+           sprintf(sp, "%u", curr_stats->TotalFetchs);
        } else
            sp = sblank;
        code = mini_justify(sp, /*Src buffer */
@@ -1398,7 +1398,7 @@ FS_Handler(void)
        lightdata = (struct gator_lightobj *)(curr_line->stores_lp->o_data);
        if (*curr_probeOK == 0) {
            sp = s;
-           sprintf(sp, "%d", curr_stats->TotalStores);
+           sprintf(sp, "%u", curr_stats->TotalStores);
        } else
            sp = sblank;
        code = mini_justify(sp, /*Src buffer */
@@ -1508,7 +1508,7 @@ FS_Handler(void)
  *------------------------------------------------------------------------*/
 
 static int
-init_mini_line(struct sockaddr_in *a_skt, int a_lineNum, 
+init_mini_line(struct sockaddr_in *a_skt, int a_lineNum,
               struct mini_line *a_line, char *a_srvname)
 {                              /*init_mini_line */
 
@@ -1639,7 +1639,7 @@ execute_scout(int a_numservers, struct cmd_item *a_srvname, int a_pkg)
 
     static char rn[] = "execute_scout";        /*Routine name */
     static char fullsrvname[128];      /*Full server name */
-    register int code;         /*Return code */
+    int code;          /*Return code */
     struct sockaddr_in *FSSktArray;    /*Server socket array */
     int sktbytes;              /*Num bytes in above */
     struct sockaddr_in *curr_skt;      /*Ptr to current socket */
@@ -1738,12 +1738,8 @@ execute_scout(int a_numservers, struct cmd_item *a_srvname, int a_pkg)
            return (-1);
        }
        memcpy(&(curr_skt->sin_addr.s_addr), he->h_addr, 4);
-#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
-       curr_skt->sin_family = AF_INET;         /*Internet family */
-#else
-       curr_skt->sin_family = htons(AF_INET);  /*Internet family */
-#endif
-       curr_skt->sin_port = htons(7000);       /*FileServer port */
+       curr_skt->sin_family = AF_INET;
+       curr_skt->sin_port = htons(7000);       /* FileServer port */
 
        /*
         * Bump our pointers.
@@ -2359,13 +2355,13 @@ int
 main(int argc, char **argv)
 {                              /*main */
 
-    register afs_int32 code;   /*Return code */
-    register struct cmd_syndesc *ts;   /*Ptr to cmd line syntax descriptor */
+    afs_int32 code;    /*Return code */
+    struct cmd_syndesc *ts;    /*Ptr to cmd line syntax descriptor */
 
 #ifdef AFS_AIX32_ENV
     /*
-     * The following signal action for AIX is necessary so that in case of a 
-     * crash (i.e. core is generated) we can include the user's data section 
+     * The following signal action for AIX is necessary so that in case of a
+     * crash (i.e. core is generated) we can include the user's data section
      * in the core dump. Unfortunately, by default, only a partial core is
      * generated which, in many cases, isn't too useful.
      */