libadmin-cleanup-and-afsconfigization-20010604
authorNathan Neulinger <nneul@umr.edu>
Mon, 4 Jun 2001 22:07:27 +0000 (22:07 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 4 Jun 2001 22:07:27 +0000 (22:07 +0000)
clean up warnings, get rid of unused variables, and set up for use of
afsconfig.h

src/libadmin/vos/Makefile
src/libadmin/vos/afs_vosAdmin.c
src/libadmin/vos/lockprocs.c
src/libadmin/vos/lockprocs.h
src/libadmin/vos/vosutils.c
src/libadmin/vos/vosutils.h
src/libadmin/vos/vsprocs.c
src/libadmin/vos/vsprocs.h

index be743df..797ec28 100644 (file)
@@ -9,7 +9,7 @@ SHELL = /bin/sh
 include ../../config/Makefile.${SYS_NAME}
 
 CC = ${MT_CC}
-CFLAGS = ${OPTMZ} ${DBG} -I${SRCDIR}include ${MT_CFLAGS}
+CFLAGS = ${OPTMZ} ${DBG} -I${TOP_SRCDIR}/config -I${SRCDIR}include ${MT_CFLAGS}
 CCRULE = ${CC} ${CFLAGS} -c $?
 
 VLSERVER = ../../vlserver/
index c67180c..c8558a7 100644 (file)
@@ -8,14 +8,23 @@
  */
 
 #include <afs/param.h>
+#include <afsconfig.h>
 #include <afs/stds.h>
 #include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#include <ctype.h>
 #ifdef AFS_NT40_ENV
 #include <winsock2.h>
 #include <io.h>
 #else
 #include <sys/types.h>
 #include <sys/socket.h>
+#include <unistd.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <netdb.h>
@@ -2054,7 +2063,6 @@ static int GetVLDBEntryRPC(
     int rc = 0;
     afs_status_t tst = 0;
     vldb_entry_get_p entry = (vldb_entry_get_p) rpc_specific;
-    int index = entry->index;
 
     /*
      * Copy the next entry into the cache
@@ -2171,7 +2179,6 @@ int ADMINAPI vos_VLDBGetBegin(
     afs_admin_iterator_p iter = (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
     vldb_entry_get_p entry = (vldb_entry_get_p) calloc(1, sizeof(vldb_entry_get_t));
     struct VldbListByAttributes attr;
-    afs_int32 nentries = 0;
 
     attr.Mask = 0;
     memset(&attr, 0, sizeof(attr));
@@ -3665,8 +3672,6 @@ static int copyvolintXInfo(
 
     rc = 1;
 
-fail_copyvolintXInfo:
-
     if (st != NULL) {
        *st = tst;
     }
@@ -3785,7 +3790,6 @@ static int GetVolumeRPC(
     int rc = 0;
     afs_status_t tst = 0;
     volume_get_p entry = (volume_get_p) rpc_specific;
-    int index = entry->index;
 
     /*
      * Copy the next entry into the cache
index 452b3df..ff00e1a 100644 (file)
@@ -8,6 +8,12 @@
  */
 
 #include "lockprocs.h"
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
 
 /* Finds an index in VLDB entry that matches the volume type, server, and partition.
  * If type is zero, will match first index of ANY type (RW, BK, or RO).
@@ -58,7 +64,6 @@ static void SetAValue (
   afs_int32 type)
 {
     int e;
-    afs_int32 error = 0;
 
     e = FindIndex(cellHandle, entry, oserver, opart, type);
     if (e == -1)
index 62d9725..e60137d 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <afs/param.h>
+#include <afsconfig.h>
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
 #include <winsock2.h>
index 6ac500a..ef927ef 100644 (file)
 #include "vsprocs.h"
 #include "lockprocs.h"
 #include <afs/afs_AdminErrors.h>
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
 
 /*
  * Functions that aren't prototyped, but that we use
index 13882da..7700a5f 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <afs/param.h>
+#include <afsconfig.h>
 #include <afs/stds.h>
 #include <afs/afs_Admin.h>
 #include <afs/vlserver.h>
index 2453296..36b049d 100644 (file)
 #include "../adminutil/afs_AdminInternal.h"
 #include <afs/afs_AdminErrors.h>
 #include "afs_vosAdmin.h"
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 #ifdef AFS_NT40_ENV
 #include <io.h>
 #endif
 
-static GroupEntries();
+static afs_int32 GroupEntries();
 
 struct release {
   afs_int32 time;
@@ -946,10 +955,9 @@ int UV_BackupVolume(
     afs_status_t tst = 0, temp = 0;
     afs_int32 ttid = 0, btid = 0;
     afs_int32 backupID;
-    afs_int32 code = 0, rcode = 0;
+    afs_int32 rcode = 0;
     char vname[VOLSER_MAXVOLNAME +1];
     struct nvldbentry entry;
-    afs_int32 error = 0;
     int vldblocked = 0, vldbmod = 0, backexists = 1;
     struct rx_connection *aconn = UV_Bind(cellHandle, aserver,
                                          AFSCONF_VOLUMEPORT);
@@ -1151,6 +1159,7 @@ static int DelVol (
 #define ONERROR(ec, ep, es) if (ec) { fprintf(STDERR, (es), (ep)); error = (ec); goto rfail; }
 #define ERROREXIT(ec) { error = (ec); goto rfail; }
 
+#if 0 /* doesn't appear to be used, why compile it */
 static int CloneVol (
   afs_cell_handle_p cellHandle,
   struct rx_connection *conn,
@@ -1255,6 +1264,7 @@ fail_CloneVol:
     }
     return rc;
 }
+#endif
 
 /* Get a "transaction" on this replica.  Create the volume 
  * if necessary.  Return the time from which a dump should
@@ -1371,13 +1381,6 @@ static int SimulateForwardMultiple(
 }
 
 
-static int rel_compar (
-  struct release *r1,
-  struct release *r2)
-{
-  return (r1->time - r2->time);
-}
-
 /* VolumeExists()
  *      Determine if a volume exists on a server and partition.
  *      Try creating a transaction on the volume. If we can,
@@ -1393,7 +1396,7 @@ static afs_int32 VolumeExists(
   afs_status_p st)
 {
    int rc = 0;
-   afs_status_t tst = -1;
+   afs_status_t tst = 0;
    struct rx_connection *conn=(struct rx_connection *)0;
    volEntries           volumeInfo;
  
@@ -1443,16 +1446,15 @@ int UV_ReleaseVolume(
   struct release *times=0;
   int nservers = 0;
   struct rx_connection *fromconn = (struct rx_connection *)0;
-  afs_int32 error = 0;
   int islocked = 0;
   afs_int32 clonetid=0, onlinetid;
   afs_int32 fromtid=0;
-  afs_uint32 fromdate, thisdate;
+  afs_uint32 fromdate=0, thisdate;
   int s;
   manyDests tr;
   manyResults results;
   int rwindex, roindex, roclone, roexists;
-  afs_int32 rwcrdate;
+  afs_int32 rwcrdate = 0;
   struct rtime {
     int     validtime;
     afs_uint32 time;
@@ -2062,7 +2064,7 @@ int UV_DumpVolume(
     if(tst) {
        goto fail_UV_DumpVolume;
     }
-    if (tst = DumpFunction(fromcall,filename)) {
+    if ((tst = DumpFunction(fromcall,filename))) {
        goto fail_UV_DumpVolume;
     }
     tst = rx_EndCall(fromcall,rxError);
@@ -2225,7 +2227,7 @@ int UV_RestoreVolume(
     afs_status_t etst = 0;
     struct rx_connection *toconn,*tempconn;
     struct rx_call *tocall;
-    afs_int32 totid, rcode, terror = 0;
+    afs_int32 totid, rcode;
     afs_int32 rxError = 0;
     struct volser_status tstatus;
     char partName[10];
@@ -2500,7 +2502,6 @@ int UV_AddSite(
     afs_status_t tst = 0;
     int j, nro=0, islocked=0;
     struct nvldbentry entry;
-    afs_int32 error=0;
     int same = 0;
 
     tst = ubik_Call(VL_SetLock, cellHandle->vos, 0,volid,RWVOL, VLOP_ADDSITE);
@@ -2580,7 +2581,7 @@ int UV_RemoveSite(
     int rc = 0;
     afs_status_t tst = 0;
     struct nvldbentry entry;
-    int islocked;
+    int islocked = 0;
 
     tst = ubik_Call(VL_SetLock, cellHandle->vos, 0,volid, RWVOL, VLOP_ADDSITE);
     if(tst) {
@@ -3204,7 +3205,6 @@ static afs_int32 CheckVldbRWBK(
    afs_status_t tst = 0;
    int modentry = 0;
    int idx;
-   afs_int32 error = 0;
  
    if (modified) *modified = 0;
    idx = Lp_GetRwIndex(cellHandle, entry, 0);
@@ -3312,7 +3312,6 @@ static int CheckVldbRO(
    afs_status_t tst = 0;
    int idx;
    int foundro = 0, modentry = 0;
-   afs_int32 error = 0;
  
    if (modified) *modified = 0;
  
@@ -3374,8 +3373,7 @@ int CheckVldb(
     int rc = 0;
     afs_status_t tst = 0;
     afs_int32 vcode;
-    int islocked;
-    struct rx_connection *server = NULL;
+    int islocked = 0;
     int pass = 0;
     afs_int32 modentry = 0;
     afs_int32 delentry = 0;
@@ -3707,7 +3705,7 @@ fail_UV_RenameVolume:
 *if the volume is rw. <count> is the number of entries to be processesd.
 *<pntr> points to the first entry.< myQueue> is the queue with entries 
 *grouped */
-static int GroupEntries(
+static afs_int32 GroupEntries(
   struct rx_connection *server,
   volintInfo *pntr,
   afs_int32 count,
index 0629f92..8553f3f 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <afs/param.h>
+#include <afsconfig.h>
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>