From 0e29705b4632bb2e1ba647344f296e269cd29e9d Mon Sep 17 00:00:00 2001 From: Nathan Neulinger Date: Mon, 4 Jun 2001 22:07:27 +0000 Subject: [PATCH] libadmin-cleanup-and-afsconfigization-20010604 clean up warnings, get rid of unused variables, and set up for use of afsconfig.h --- src/libadmin/vos/Makefile | 2 +- src/libadmin/vos/afs_vosAdmin.c | 14 +++++++---- src/libadmin/vos/lockprocs.c | 7 +++++- src/libadmin/vos/lockprocs.h | 1 + src/libadmin/vos/vosutils.c | 6 +++++ src/libadmin/vos/vosutils.h | 1 + src/libadmin/vos/vsprocs.c | 44 ++++++++++++++++----------------- src/libadmin/vos/vsprocs.h | 1 + 8 files changed, 46 insertions(+), 30 deletions(-) diff --git a/src/libadmin/vos/Makefile b/src/libadmin/vos/Makefile index be743dffd..797ec28d7 100644 --- a/src/libadmin/vos/Makefile +++ b/src/libadmin/vos/Makefile @@ -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/ diff --git a/src/libadmin/vos/afs_vosAdmin.c b/src/libadmin/vos/afs_vosAdmin.c index c67180cb6..c8558a7c2 100644 --- a/src/libadmin/vos/afs_vosAdmin.c +++ b/src/libadmin/vos/afs_vosAdmin.c @@ -8,14 +8,23 @@ */ #include +#include #include #include +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_STRINGS_H +#include +#endif +#include #ifdef AFS_NT40_ENV #include #include #else #include #include +#include #include #include #include @@ -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 diff --git a/src/libadmin/vos/lockprocs.c b/src/libadmin/vos/lockprocs.c index 452b3dff5..ff00e1a94 100644 --- a/src/libadmin/vos/lockprocs.c +++ b/src/libadmin/vos/lockprocs.c @@ -8,6 +8,12 @@ */ #include "lockprocs.h" +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_STRINGS_H +#include +#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) diff --git a/src/libadmin/vos/lockprocs.h b/src/libadmin/vos/lockprocs.h index 62d972568..e60137db7 100644 --- a/src/libadmin/vos/lockprocs.h +++ b/src/libadmin/vos/lockprocs.h @@ -8,6 +8,7 @@ */ #include +#include #include #ifdef AFS_NT40_ENV #include diff --git a/src/libadmin/vos/vosutils.c b/src/libadmin/vos/vosutils.c index 6ac500abd..ef927ef51 100644 --- a/src/libadmin/vos/vosutils.c +++ b/src/libadmin/vos/vosutils.c @@ -11,6 +11,12 @@ #include "vsprocs.h" #include "lockprocs.h" #include +#ifdef HAVE_STRINGS_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif /* * Functions that aren't prototyped, but that we use diff --git a/src/libadmin/vos/vosutils.h b/src/libadmin/vos/vosutils.h index 13882da1b..7700a5fc3 100644 --- a/src/libadmin/vos/vosutils.h +++ b/src/libadmin/vos/vosutils.h @@ -8,6 +8,7 @@ */ #include +#include #include #include #include diff --git a/src/libadmin/vos/vsprocs.c b/src/libadmin/vos/vsprocs.c index 2453296b8..36b049d83 100644 --- a/src/libadmin/vos/vsprocs.c +++ b/src/libadmin/vos/vsprocs.c @@ -24,11 +24,20 @@ #include "../adminutil/afs_AdminInternal.h" #include #include "afs_vosAdmin.h" +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_STRINGS_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif #ifdef AFS_NT40_ENV #include #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. is the number of entries to be processesd. * 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, diff --git a/src/libadmin/vos/vsprocs.h b/src/libadmin/vos/vsprocs.h index 0629f922b..8553f3fd9 100644 --- a/src/libadmin/vos/vsprocs.h +++ b/src/libadmin/vos/vsprocs.h @@ -8,6 +8,7 @@ */ #include +#include #include #include #include -- 2.39.5