pull-prototypes-to-head-20020821
[openafs.git] / src / fsprobe / fsprobe.c
index 895980c..1027b77 100644 (file)
 
 RCSID("$Header$");
 
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+
 #include <fsprobe.h>                   /*Interface for this module*/
 #include <lwp.h>                       /*Lightweight process package*/
 #include <afs/cellconfig.h>
@@ -100,7 +109,7 @@ static int fsprobe_CleanupInit()
     rxcall        = (struct rx_call *)0;
     Fids_Array    = (AFSCBFids *)0;
     CallBack_Array = (AFSCBs *)0;
-    interfaceAddr  = (struct interfaceAddr *)0;
+    interfaceAddr  = NULL;
 
     code = SRXAFSCB_CallBack(rxcall, Fids_Array, CallBack_Array);
     if (code)
@@ -194,7 +203,7 @@ int fsprobe_Cleanup(a_releaseMem)
     if (a_releaseMem) {
       if (fsprobe_ConnInfo != (struct fsprobe_ConnectionInfo *)0)
        free(fsprobe_ConnInfo);
-      if (fsprobe_Results.stats != (struct ProbeViceStatistics *)0)
+      if (fsprobe_Results.stats != NULL)
        free(fsprobe_Results.stats);
       if (fsprobe_Results.probeOK != (int *)0)
        free(fsprobe_Results.probeOK);
@@ -370,7 +379,7 @@ tryold:
        goto out;
     }
     partEnts.partEntries_len = 0;
-    partEnts.partEntries_val = (afs_int32 *)0;
+    partEnts.partEntries_val = NULL;
     code = AFSVolXListPartitions(aconn, &partEnts);
     if (!newvolserver) {
        if (code == RXGEN_OPCODE) {
@@ -524,7 +533,7 @@ int fsprobe_Init(a_numServers, a_socketArray, a_ProbeFreqInSecs, a_ProbeHandler,
     fsprobe_statsBytes = a_numServers * sizeof(struct ProbeViceStatistics);
     fsprobe_Results.stats = (struct ProbeViceStatistics *)
       malloc(fsprobe_statsBytes);
-    if (fsprobe_Results.stats == (struct ProbeViceStatistics *)0) {
+    if (fsprobe_Results.stats == NULL) {
       fprintf(stderr,
              "[%s] Can't allocate %d statistics structs (%d bytes)\n",
              rn, a_numServers, fsprobe_statsBytes);
@@ -583,7 +592,7 @@ int fsprobe_Init(a_numServers, a_socketArray, a_ProbeFreqInSecs, a_ProbeHandler,
      * Create a null Rx server security object, to be used by the
      * Callback listener.
      */
-    CBsecobj = (struct rx_securityClass *) rxnull_NewServerSecurityObject();
+    CBsecobj = rxnull_NewServerSecurityObject();
     if (CBsecobj == (struct rx_securityClass *)0) {
       fprintf(stderr,
              "[%s] Can't create null security object for the callback listener.\n",
@@ -598,7 +607,7 @@ int fsprobe_Init(a_numServers, a_socketArray, a_ProbeFreqInSecs, a_ProbeHandler,
      * Create a null Rx client security object, to be used by the
      * probe LWP.
      */
-    secobj = (struct rx_securityClass *) rxnull_NewClientSecurityObject();
+    secobj = rxnull_NewClientSecurityObject();
     if (secobj == (struct rx_securityClass *)0) {
       fprintf(stderr,
              "[%s] Can't create client security object for probe LWP.\n",
@@ -626,7 +635,7 @@ int fsprobe_Init(a_numServers, a_socketArray, a_ProbeFreqInSecs, a_ProbeHandler,
       memcpy(&(curr_conn->skt), a_socketArray + curr_srv, sizeof(struct sockaddr_in));
 
       hostNameFound = hostutil_GetNameByINet(curr_conn->skt.sin_addr.s_addr);
-      if (hostNameFound == (char *)0) {
+      if (hostNameFound == NULL) {
        fprintf(stderr,
                "[%s] Can't map Internet address %lu to a string name\n",
                rn, curr_conn->skt.sin_addr.s_addr);