From 191df3d05770781d4a47ff210f9adf2712f8be07 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Wed, 12 Sep 2012 07:25:12 -0400 Subject: [PATCH] 1.6: fix warnings 1.6 only. fix warnings which do not exist on master Change-Id: I33927d1f3f3a45c26991bb9a60eb80bd0e6a9178 Reviewed-on: http://gerrit.openafs.org/8105 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/afs/afs_analyze.c | 3 +- src/afs/afs_bypasscache.c | 2 - src/afs/afs_cell.c | 3 +- src/afs/afs_init.c | 8 ---- src/afs/afs_osidnlc.c | 5 +-- src/afs/afs_pioctl.c | 8 ++-- src/afs/afs_segments.c | 2 - src/afs/afs_server.c | 3 -- src/afs/afs_vcache.c | 2 - src/afsmonitor/afsmon-win.c | 87 ++++++++++++++++++------------------- src/afsmonitor/afsmonitor.c | 5 +-- src/bozo/bnode.c | 13 +++--- src/bucoord/vol_sets.c | 4 -- src/budb/database.h | 6 ++- src/des/key_sched.c | 6 +-- src/kauth/authclient.c | 2 - src/kauth/kadatabase.c | 16 +++++-- src/kauth/kkids.c | 4 -- src/kauth/kpasswd.c | 2 - src/libadmin/test/pts.c | 2 - src/libadmin/vos/vsprocs.c | 24 ++-------- src/ptserver/db_verify.c | 6 +-- src/rxgen/rpc_parse.c | 5 --- src/rxkad/v5gen.c | 39 ++++++----------- src/scout/scout.c | 9 ++-- src/ubik/recovery.c | 7 +-- src/ubik/remote.c | 3 +- src/update/server.c | 2 - src/uss/uss.c | 5 +-- src/uss/uss_acl.c | 2 - src/venus/fs.c | 9 +--- src/viced/afsfileprocs.c | 6 +-- src/vol/fssync-server.c | 6 ++- src/vol/vol-salvage.c | 4 +- src/vol/volume.c | 10 +++-- src/vol/vutil.c | 2 +- src/volser/dumpstuff.c | 2 +- src/volser/restorevol.c | 2 +- src/volser/vol_split.c | 2 +- src/volser/volprocs.c | 2 +- src/xstat/xstat_fs_test.c | 16 ------- 41 files changed, 120 insertions(+), 226 deletions(-) diff --git a/src/afs/afs_analyze.c b/src/afs/afs_analyze.c index c4a0cffea..b7f4aea9f 100644 --- a/src/afs/afs_analyze.c +++ b/src/afs/afs_analyze.c @@ -427,7 +427,6 @@ afs_Analyze(struct afs_conn *aconn, struct rx_connection *rxconn, afs_int32 shouldRetry = 0; afs_int32 serversleft = 1; struct afs_stats_RPCErrors *aerrP; - afs_int32 markeddown; afs_uint32 address; if (AFS_IS_DISCONNECTED && !AFS_IN_SYNC) { @@ -665,7 +664,7 @@ afs_Analyze(struct afs_conn *aconn, struct rx_connection *rxconn, */ goto out; } - markeddown = afs_ServerDown(sa, acode); + afs_ServerDown(sa, acode); ForceNewConnections(sa); /**multi homed clients lock:afs_xsrvAddr? */ if (aerrP) (aerrP->err_Server)++; diff --git a/src/afs/afs_bypasscache.c b/src/afs/afs_bypasscache.c index e4470243c..7370dc04d 100644 --- a/src/afs/afs_bypasscache.c +++ b/src/afs/afs_bypasscache.c @@ -568,7 +568,6 @@ afs_PrefetchNoCache(struct vcache *avc, #endif struct afs_conn *tc; - afs_int32 i; struct rx_call *tcall; struct tlocal1 { struct AFSVolSync tsync; @@ -588,7 +587,6 @@ afs_PrefetchNoCache(struct vcache *avc, tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK /* ignored */, &rxconn); if (tc) { avc->callback = tc->srvr->server; - i = osi_Time(); tcall = rx_NewCall(rxconn); #ifdef AFS_64BIT_CLIENT if (!afs_serverHasNo64Bit(tc)) { diff --git a/src/afs/afs_cell.c b/src/afs/afs_cell.c index 016aa2e6a..3e4259a5f 100644 --- a/src/afs/afs_cell.c +++ b/src/afs/afs_cell.c @@ -331,7 +331,6 @@ afs_cellname_init(afs_dcache_id_t *inode, int lookupcode) while (1) { afs_int32 cellnum, clen, magic; - struct cell_name *cn; char *cellname; cc = afs_osi_Read(tfile, off, &magic, sizeof(magic)); @@ -369,7 +368,7 @@ afs_cellname_init(afs_dcache_id_t *inode, int lookupcode) break; } - cn = afs_cellname_new(cellname, cellnum); + afs_cellname_new(cellname, cellnum); afs_osi_Free(cellname, clen + 1); } diff --git a/src/afs/afs_init.c b/src/afs/afs_init.c index cf0636a60..431d89dd0 100644 --- a/src/afs/afs_init.c +++ b/src/afs/afs_init.c @@ -724,11 +724,6 @@ shutdown_cache(void) void shutdown_vnodeops(void) { -#if !defined(AFS_SGI_ENV) && !defined(AFS_SUN5_ENV) - struct buf *afs_bread_freebp = 0; -#endif - - AFS_STATCNT(shutdown_vnodeops); if (afs_cold_shutdown) { #ifndef AFS_SUN5_ENV /* XXX */ @@ -736,9 +731,6 @@ shutdown_vnodeops(void) #endif #ifndef AFS_LINUX20_ENV afs_rd_stash_i = 0; -#endif -#if !defined(AFS_SGI_ENV) && !defined(AFS_SUN5_ENV) - afs_bread_freebp = 0; #endif shutdown_mariner(); } diff --git a/src/afs/afs_osidnlc.c b/src/afs/afs_osidnlc.c index d2a661696..0309e9a90 100644 --- a/src/afs/afs_osidnlc.c +++ b/src/afs/afs_osidnlc.c @@ -190,10 +190,9 @@ struct vcache * osi_dnlc_lookup(struct vcache *adp, char *aname, int locktype) { struct vcache *tvc; - int LRUme; unsigned int key, skey; char *ts = aname; - struct nc *tnc, *tnc1 = 0; + struct nc *tnc; int safety; #ifdef AFS_DARWIN80_ENV vnode_t tvp; @@ -218,7 +217,6 @@ osi_dnlc_lookup(struct vcache *adp, char *aname, int locktype) if ( /* (tnc->key == key) && */ (tnc->dirp == adp) && (!strcmp((char *)tnc->name, aname))) { tvc = tnc->vp; - tnc1 = tnc; break; } else if (tnc->next == nameHash[skey]) { /* end of list */ break; @@ -232,7 +230,6 @@ osi_dnlc_lookup(struct vcache *adp, char *aname, int locktype) } } - LRUme = 0; /* (tnc != nameHash[skey]); */ ReleaseReadLock(&afs_xdnlc); if (!tvc) { diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c index b0b1b9870..d96a84275 100644 --- a/src/afs/afs_pioctl.c +++ b/src/afs/afs_pioctl.c @@ -4854,8 +4854,8 @@ DECL_PIOCTL(PRxStatPeer) DECL_PIOCTL(PPrefetchFromTape) { - afs_int32 code, code1; - afs_int32 bytes, outval; + afs_int32 code; + afs_int32 outval; struct afs_conn *tc; struct rx_call *tcall; struct AFSVolSync tsync; @@ -4898,11 +4898,11 @@ DECL_PIOCTL(PPrefetchFromTape) StartRXAFS_FetchData(tcall, (struct AFSFid *)&tvc->f.fid.Fid, 0, 0); if (!code) { - bytes = rx_Read(tcall, (char *)&outval, sizeof(afs_int32)); + rx_Read(tcall, (char *)&outval, sizeof(afs_int32)); code = EndRXAFS_FetchData(tcall, &OutStatus, &CallBack, &tsync); } - code1 = rx_EndCall(tcall, code); + code = rx_EndCall(tcall, code); RX_AFS_GLOCK(); } else code = -1; diff --git a/src/afs/afs_segments.c b/src/afs/afs_segments.c index 0c3246284..192a3d4b4 100644 --- a/src/afs/afs_segments.c +++ b/src/afs/afs_segments.c @@ -169,7 +169,6 @@ afs_StoreAllSegments(struct vcache *avc, struct vrequest *areq, afs_hyper_t newDV, oldDV; /* DV when we start, and finish, respectively */ struct dcache **dcList; unsigned int i, j, minj, moredata, high, off; - afs_size_t tlen; afs_size_t maxStoredLength; /* highest offset we've written to server. */ int safety, marineronce = 0; @@ -238,7 +237,6 @@ afs_StoreAllSegments(struct vcache *avc, struct vrequest *areq, origCBs = afs_allCBs; maxStoredLength = 0; - tlen = avc->f.m.Length; minj = 0; do { diff --git a/src/afs/afs_server.c b/src/afs/afs_server.c index 1f553cdcf..178169f45 100644 --- a/src/afs/afs_server.c +++ b/src/afs/afs_server.c @@ -1880,7 +1880,6 @@ afs_GetServer(afs_uint32 *aserverp, afs_int32 nservers, afs_int32 acell, { struct server *oldts = 0, *ts, *newts, *orphts = 0; struct srvAddr *oldsa, *newsa, *nextsa, *orphsa; - u_short fsport; afs_int32 iphash, k, srvcount = 0; unsigned int srvhash; @@ -1964,8 +1963,6 @@ afs_GetServer(afs_uint32 *aserverp, afs_int32 nservers, afs_int32 acell, if (acell) newts->cell = afs_GetCell(acell, 0); - fsport = (newts->cell ? newts->cell->fsport : AFS_FSPORT); - /* For each IP address we are registering */ for (k = 0; k < nservers; k++) { iphash = SHash(aserverp[k]); diff --git a/src/afs/afs_vcache.c b/src/afs/afs_vcache.c index 8b7115c9e..793d0353b 100644 --- a/src/afs/afs_vcache.c +++ b/src/afs/afs_vcache.c @@ -1510,7 +1510,6 @@ afs_RemoteLookup(struct VenusFid *afid, struct vrequest *areq, struct AFSVolSync *tsyncp) { afs_int32 code; - afs_uint32 start; struct afs_conn *tc; struct rx_connection *rxconn; struct AFSFetchStatus OutDirStatus; @@ -1522,7 +1521,6 @@ afs_RemoteLookup(struct VenusFid *afid, struct vrequest *areq, if (tc) { if (serverp) *serverp = tc->srvr->server; - start = osi_Time(); XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_XLOOKUP); RX_AFS_GUNLOCK(); code = diff --git a/src/afsmonitor/afsmon-win.c b/src/afsmonitor/afsmon-win.c index f3e2188bd..550d313c8 100644 --- a/src/afsmonitor/afsmon-win.c +++ b/src/afsmonitor/afsmon-win.c @@ -1036,7 +1036,6 @@ create_ovwFrame_objects(void) int hostLines; /* number of lines of host names to display */ struct onode **ovw_fsNames_o_Ptr; /* index to list of fs names onodes */ struct onode **ovw_cmNames_o_Ptr; /* index to list of cm names onodes */ - int code; int i; if (afsmon_debug) { @@ -1066,8 +1065,8 @@ create_ovwFrame_objects(void) sprintf(errMsg, "[ %s ] Failed to create initMsg_o onode\n", rn); afsmon_Exit(250); } - code = gtxframe_AddToList(ovwFrame, initMsg_o); - code = gator_light_set(initMsg_o, HIGHLIGHT); + gtxframe_AddToList(ovwFrame, initMsg_o); + gator_light_set(initMsg_o, HIGHLIGHT); initMsg_on = 1; @@ -1079,8 +1078,8 @@ create_ovwFrame_objects(void) sprintf(errMsg, "[ %s ] Failed to create command onode\n", rn); afsmon_Exit(265); } - code = gtxframe_AddToList(ovwFrame, ovw_cmd_o); - code = gator_light_set(ovw_cmd_o, HIGHLIGHT); + gtxframe_AddToList(ovwFrame, ovw_cmd_o); + gator_light_set(ovw_cmd_o, HIGHLIGHT); /* create the program name object */ @@ -1089,8 +1088,8 @@ create_ovwFrame_objects(void) sprintf(errMsg, "[ %s ] Failed to create programName onode\n", rn); afsmon_Exit(255); } - code = gtxframe_AddToList(ovwFrame, ovw_progName_o); - code = gator_light_set(ovw_progName_o, HIGHLIGHT); + gtxframe_AddToList(ovwFrame, ovw_progName_o); + gator_light_set(ovw_progName_o, HIGHLIGHT); /* create the page number object */ @@ -1101,8 +1100,8 @@ create_ovwFrame_objects(void) sprintf(errMsg, "[ %s ] Failed to create pageNumber onode\n", rn); afsmon_Exit(260); } - code = gtxframe_AddToList(ovwFrame, ovw_pageNum_o); - code = gator_light_set(ovw_pageNum_o, HIGHLIGHT); + gtxframe_AddToList(ovwFrame, ovw_pageNum_o); + gator_light_set(ovw_pageNum_o, HIGHLIGHT); /* create the probe number object */ ovw_probeNum_o = @@ -1112,8 +1111,8 @@ create_ovwFrame_objects(void) sprintf(errMsg, "[ %s ] Failed to create probe number onode\n", rn); afsmon_Exit(270); } - code = gtxframe_AddToList(ovwFrame, ovw_probeNum_o); - code = gator_light_set(ovw_probeNum_o, HIGHLIGHT); + gtxframe_AddToList(ovwFrame, ovw_probeNum_o); + gator_light_set(ovw_probeNum_o, HIGHLIGHT); /* create the numFS monitored object */ ovw_numFS_o = initLightObject("", 0, 2, FC_NUMHOSTS_O_WIDTH, afsmon_win); @@ -1121,7 +1120,7 @@ create_ovwFrame_objects(void) sprintf(errMsg, "[ %s ] Failed to create numFS onode\n", rn); afsmon_Exit(275); } - code = gtxframe_AddToList(ovwFrame, ovw_numFS_o); + gtxframe_AddToList(ovwFrame, ovw_numFS_o); /* create the numCM monitored object */ ovw_numCM_o = @@ -1130,7 +1129,7 @@ create_ovwFrame_objects(void) sprintf(errMsg, "[ %s ] Failed to create numCM_o onode\n", rn); afsmon_Exit(280); } - code = gtxframe_AddToList(ovwFrame, ovw_numCM_o); + gtxframe_AddToList(ovwFrame, ovw_numCM_o); /* create the number-of-FS-alerts object */ ovw_FSalerts_o = @@ -1139,7 +1138,7 @@ create_ovwFrame_objects(void) sprintf(errMsg, "[ %s ] Failed to create FSalerts_o onode\n", rn); afsmon_Exit(285); } - code = gtxframe_AddToList(ovwFrame, ovw_FSalerts_o); + gtxframe_AddToList(ovwFrame, ovw_FSalerts_o); /* create the number-of-CM-alerts object */ ovw_CMalerts_o = @@ -1148,7 +1147,7 @@ create_ovwFrame_objects(void) sprintf(errMsg, "[ %s ] Failed to create CMalerts_o onode\n", rn); afsmon_Exit(290); } - code = gtxframe_AddToList(ovwFrame, ovw_CMalerts_o); + gtxframe_AddToList(ovwFrame, ovw_CMalerts_o); /* create file-server-name and cache-manager-names objects */ ovw_numHosts_perPage = maxY - OVW_NUM_FIXED_LINES; @@ -1180,7 +1179,7 @@ create_ovwFrame_objects(void) * fflush(debugFD); * } */ - code = gtxframe_AddToList(ovwFrame, *ovw_fsNames_o_Ptr); + gtxframe_AddToList(ovwFrame, *ovw_fsNames_o_Ptr); ovw_fsNames_o_Ptr++; } @@ -1206,7 +1205,7 @@ create_ovwFrame_objects(void) sprintf(errMsg, "[ %s ] Failed to create a CM name onode\n", rn); afsmon_Exit(310); } - code = gtxframe_AddToList(ovwFrame, *ovw_cmNames_o_Ptr); + gtxframe_AddToList(ovwFrame, *ovw_cmNames_o_Ptr); ovw_cmNames_o_Ptr++; } @@ -2080,7 +2079,6 @@ create_FSframe_objects(void) struct onode **fsLabels_o_Ptr; int x_pos; int y_pos; - int code; int i; int j; int numBytes; @@ -2100,13 +2098,13 @@ create_FSframe_objects(void) sprintf(errMsg, "[ %s ] Failed to create fs command onode\n", rn); afsmon_Exit(340); } - code = gtxframe_AddToList(fsFrame, fs_cmd_o); - code = gator_light_set(fs_cmd_o, HIGHLIGHT); + gtxframe_AddToList(fsFrame, fs_cmd_o); + gator_light_set(fs_cmd_o, HIGHLIGHT); /* we already have the dimensions for the frame - same as the ovw frame */ /* use the ovw program name object for the fs screen too */ - code = gtxframe_AddToList(fsFrame, ovw_progName_o); + gtxframe_AddToList(fsFrame, ovw_progName_o); /* create the page number object */ @@ -2118,8 +2116,8 @@ create_FSframe_objects(void) sprintf(errMsg, "[ %s ] Failed to create pageNumber onode\n", rn); afsmon_Exit(335); } - code = gtxframe_AddToList(fsFrame, fs_pageNum_o); - code = gator_light_set(fs_pageNum_o, HIGHLIGHT); + gtxframe_AddToList(fsFrame, fs_pageNum_o); + gator_light_set(fs_pageNum_o, HIGHLIGHT); /* create the probe number object */ fs_probeNum_o = @@ -2130,8 +2128,8 @@ create_FSframe_objects(void) sprintf(errMsg, "[ %s ] Failed to create fs probeNum onode\n", rn); afsmon_Exit(345); } - code = gtxframe_AddToList(fsFrame, fs_probeNum_o); - code = gator_light_set(fs_probeNum_o, HIGHLIGHT); + gtxframe_AddToList(fsFrame, fs_probeNum_o); + gator_light_set(fs_probeNum_o, HIGHLIGHT); /* create the numFS monitored object */ @@ -2144,7 +2142,7 @@ create_FSframe_objects(void) "[ %s ] Failed to create numFS onode for the fs frame\n", rn); afsmon_Exit(350); } - code = gtxframe_AddToList(fsFrame, fs_numFS_o); + gtxframe_AddToList(fsFrame, fs_numFS_o); /* create the "more columns to left" indicator */ fs_leftArrows_o = @@ -2155,7 +2153,7 @@ create_FSframe_objects(void) rn); afsmon_Exit(355); } - code = gtxframe_AddToList(fsFrame, fs_leftArrows_o); + gtxframe_AddToList(fsFrame, fs_leftArrows_o); /* create the "more columns to right" indicator */ fs_rightArrows_o = @@ -2167,7 +2165,7 @@ create_FSframe_objects(void) rn); afsmon_Exit(360); } - code = gtxframe_AddToList(fsFrame, fs_rightArrows_o); + gtxframe_AddToList(fsFrame, fs_rightArrows_o); @@ -2230,7 +2228,7 @@ create_FSframe_objects(void) sprintf(errMsg, "[ %s ] Failed to create an FS name onode\n", rn); afsmon_Exit(375); } - code = gtxframe_AddToList(fsFrame, fs_lines_Ptr->host_o); + gtxframe_AddToList(fsFrame, fs_lines_Ptr->host_o); /* if (afsmon_debug) { * fprintf(debugFD,"[ %s ] Addr of host_o = %d for line %d\n", @@ -2261,7 +2259,7 @@ create_FSframe_objects(void) "[ %s ] Failed to create an FS data onode\n", rn); afsmon_Exit(380); } - code = gtxframe_AddToList(fsFrame, *fs_data_o_Ptr); + gtxframe_AddToList(fsFrame, *fs_data_o_Ptr); fs_data_o_Ptr++; } /* for each column */ @@ -2300,7 +2298,7 @@ create_FSframe_objects(void) rn); afsmon_Exit(390); } - code = gtxframe_AddToList(fsFrame, *fsLabels_o_Ptr); + gtxframe_AddToList(fsFrame, *fsLabels_o_Ptr); fsLabels_o_Ptr++; } @@ -2861,7 +2859,6 @@ create_CMframe_objects(void) struct onode **cmLabels_o_Ptr; int x_pos; int y_pos; - int code; int i; int j; int numBytes; @@ -2882,14 +2879,14 @@ create_CMframe_objects(void) sprintf(errMsg, "[ %s ] Failed to create cm command onode\n", rn); afsmon_Exit(420); } - code = gtxframe_AddToList(cmFrame, cm_cmd_o); - code = gator_light_set(cm_cmd_o, HIGHLIGHT); + gtxframe_AddToList(cmFrame, cm_cmd_o); + gator_light_set(cm_cmd_o, HIGHLIGHT); /* we already have the dimensions for the frame - same as the ovw frame */ /* use the ovw program name object for the cm screen too */ - code = gtxframe_AddToList(cmFrame, ovw_progName_o); + gtxframe_AddToList(cmFrame, ovw_progName_o); /* create the page number object */ @@ -2901,8 +2898,8 @@ create_CMframe_objects(void) sprintf(errMsg, "[ %s ] Failed to create pageNumber onode\n", rn); afsmon_Exit(415); } - code = gtxframe_AddToList(cmFrame, cm_pageNum_o); - code = gator_light_set(cm_pageNum_o, HIGHLIGHT); + gtxframe_AddToList(cmFrame, cm_pageNum_o); + gator_light_set(cm_pageNum_o, HIGHLIGHT); /* create the probe number object */ cm_probeNum_o = @@ -2913,8 +2910,8 @@ create_CMframe_objects(void) sprintf(errMsg, "[ %s ] Failed to create cm probeNum onode\n", rn); afsmon_Exit(425); } - code = gtxframe_AddToList(cmFrame, cm_probeNum_o); - code = gator_light_set(cm_probeNum_o, HIGHLIGHT); + gtxframe_AddToList(cmFrame, cm_probeNum_o); + gator_light_set(cm_probeNum_o, HIGHLIGHT); /* create the numCM monitored object */ @@ -2927,7 +2924,7 @@ create_CMframe_objects(void) "[ %s ] Failed to create numCM onode for the cm frame\n", rn); afsmon_Exit(430); } - code = gtxframe_AddToList(cmFrame, cm_numCM_o); + gtxframe_AddToList(cmFrame, cm_numCM_o); /* create the "more columns to left" indicator */ cm_leftArrows_o = @@ -2938,7 +2935,7 @@ create_CMframe_objects(void) rn); afsmon_Exit(435); } - code = gtxframe_AddToList(cmFrame, cm_leftArrows_o); + gtxframe_AddToList(cmFrame, cm_leftArrows_o); /* create the "more columns to right" indicator */ cm_rightArrows_o = @@ -2950,7 +2947,7 @@ create_CMframe_objects(void) rn); afsmon_Exit(440); } - code = gtxframe_AddToList(cmFrame, cm_rightArrows_o); + gtxframe_AddToList(cmFrame, cm_rightArrows_o); @@ -3013,7 +3010,7 @@ create_CMframe_objects(void) sprintf(errMsg, "[ %s ] Failed to create an CM name onode\n", rn); afsmon_Exit(455); } - code = gtxframe_AddToList(cmFrame, cm_lines_Ptr->host_o); + gtxframe_AddToList(cmFrame, cm_lines_Ptr->host_o); /* if (afsmon_debug) { * fprintf(debugFD,"[ %s ] Addr of host_o = %d for line %d\n", @@ -3044,7 +3041,7 @@ create_CMframe_objects(void) "[ %s ] Failed to create an CM data onode\n", rn); afsmon_Exit(460); } - code = gtxframe_AddToList(cmFrame, *cm_data_o_Ptr); + gtxframe_AddToList(cmFrame, *cm_data_o_Ptr); cm_data_o_Ptr++; } /* for each column */ @@ -3083,7 +3080,7 @@ create_CMframe_objects(void) rn); afsmon_Exit(470); } - code = gtxframe_AddToList(cmFrame, *cmLabels_o_Ptr); + gtxframe_AddToList(cmFrame, *cmLabels_o_Ptr); cmLabels_o_Ptr++; } diff --git a/src/afsmonitor/afsmonitor.c b/src/afsmonitor/afsmonitor.c index b5f1c466e..f7992d64c 100644 --- a/src/afsmonitor/afsmonitor.c +++ b/src/afsmonitor/afsmonitor.c @@ -1417,7 +1417,6 @@ process_config_file(char *a_config_filename) char *handlerPtr; /* ptr to pass theresh handler string */ int code = 0; /* error code */ int linenum = 0; /* config file line number */ - int threshCount; /* count of thresholds for each server */ int error_in_config; /* syntax errors in config file ?? */ int i; int numBytes; @@ -1453,7 +1452,6 @@ process_config_file(char *a_config_filename) numFS = 0; numCM = 0; - threshCount = 0; error_in_config = 0; /* flag to note if config file has syntax errors */ while ((fgets(line, CFG_STR_LEN, configFD)) != NULL) { @@ -2044,7 +2042,6 @@ execute_thresh_handler(char *a_handler, /* ptr to handler function + args */ char fileName[256]; /* file name to execute */ int i; char *ch; - int code; int argNum; int anotherArg; /* boolean used to flag if another arg is available */ @@ -2109,7 +2106,7 @@ execute_thresh_handler(char *a_handler, /* ptr to handler function + args */ if (fork() == 0) { exec_fsThreshHandler = 1; - code = afsmon_Exit(60); + afsmon_Exit(60); } return (0); diff --git a/src/bozo/bnode.c b/src/bozo/bnode.c index 6f3e2c36d..54ebf92b6 100644 --- a/src/bozo/bnode.c +++ b/src/bozo/bnode.c @@ -775,7 +775,7 @@ int hdl_notifier(struct bnode_proc *tp) { #ifndef AFS_NT40_ENV /* NT notifier callout not yet implemented */ - int code, pid; + int pid; struct stat tstat; if (stat(tp->bnode->notifier, &tstat)) { @@ -786,16 +786,15 @@ hdl_notifier(struct bnode_proc *tp) if ((pid = fork()) == 0) { FILE *fout; struct bnode *tb = tp->bnode; - int ec; #if defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_SGI51_ENV) - ec = setsid(); + setsid(); #elif defined(AFS_DARWIN90_ENV) - ec = setpgid(0, 0); + setpgid(0, 0); #elif defined(AFS_LINUX20_ENV) || defined(AFS_AIX_ENV) - ec = setpgrp(); + setpgrp(); #else - ec = setpgrp(0, 0); + setpgrp(0, 0); #endif fout = popen(tb->notifier, "w"); if (fout == NULL) { @@ -804,7 +803,7 @@ hdl_notifier(struct bnode_proc *tp) perror(tb->notifier); exit(1); } - code = SendNotifierData(fileno(fout), tp); + SendNotifierData(fileno(fout), tp); pclose(fout); exit(0); } else if (pid < 0) { diff --git a/src/bucoord/vol_sets.c b/src/bucoord/vol_sets.c index 047cec8fb..a184511ed 100644 --- a/src/bucoord/vol_sets.c +++ b/src/bucoord/vol_sets.c @@ -447,13 +447,11 @@ bc_ParseVolumeSet(void) udbClientTextP ctPtr; FILE *stream; - struct bc_config *configPtr; extern struct bc_config *bc_globalConfig; ctPtr = &bc_globalConfig->configText[TB_VOLUMESET]; stream = ctPtr->textStream; - configPtr = bc_globalConfig; /* * Open up the volume set configuration file, fail if it can't be done. @@ -601,13 +599,11 @@ bc_SaveVolumeSet(void) udbClientTextP ctPtr; FILE *stream; - struct bc_config *configPtr; extern struct bc_config *bc_globalConfig; ctPtr = &bc_globalConfig->configText[TB_VOLUMESET]; stream = ctPtr->textStream; - configPtr = bc_globalConfig; /* must be locked */ if (ctPtr->lockHandle == 0) diff --git a/src/budb/database.h b/src/budb/database.h index 6a359a7d8..fdb3da598 100644 --- a/src/budb/database.h +++ b/src/budb/database.h @@ -12,6 +12,10 @@ #include #include "budb.h" +#if !defined(offsetof) +#include /* for definition of offsetof() */ +#endif + typedef afs_uint32 dbadr; struct hashTable { @@ -289,7 +293,7 @@ struct memoryDB { /* in core copies of database structures */ extern struct memoryDB db; #define set_header_word(ut,field,value) \ - dbwrite ((ut), ((char *)&(db.h.field) - (char *)&db.h), \ + dbwrite ((ut), (offsetof(struct dbHeader, field)), \ ((db.h.field = (value)), (char *)&(db.h.field)), \ sizeof(afs_int32)) diff --git a/src/des/key_sched.c b/src/des/key_sched.c index d85691481..c6654f3ff 100644 --- a/src/des/key_sched.c +++ b/src/des/key_sched.c @@ -55,17 +55,13 @@ des_key_sched(des_cblock k, des_key_schedule schedule) { /* better pass 8 bytes, length not checked here */ - int i, j, n; /* i = r10, j = r9, n = r8 */ + int i, j; unsigned int temp; /* r7 */ char *p_char; /* r6 */ key k_char; i = 8; - n = 0; p_char = k_char; -#ifdef lint - n = n; /* fool it in case of VAXASM */ -#endif #ifdef DEBUG if (des_debug) fprintf(stderr, "\n\ninput key, left to right = "); diff --git a/src/kauth/authclient.c b/src/kauth/authclient.c index 2831a12a4..0d577714e 100644 --- a/src/kauth/authclient.c +++ b/src/kauth/authclient.c @@ -352,12 +352,10 @@ CheckTicketAnswer(ka_BBS * oanswer, afs_int32 challenge, afs_int32 * pwexpires) { struct ka_ticketAnswer *answer; - afs_uint32 cksum; unsigned char tempc; answer = (struct ka_ticketAnswer *)oanswer->SeqBody; - cksum = ntohl(answer->cksum); if (challenge != ntohl(answer->challenge)) return KABADPROTOCOL; memcpy(&token->sessionKey, &answer->sessionKey, diff --git a/src/kauth/kadatabase.c b/src/kauth/kadatabase.c index b204225da..0a9fe9ca9 100644 --- a/src/kauth/kadatabase.c +++ b/src/kauth/kadatabase.c @@ -26,11 +26,15 @@ #include "kautils.h" #include "kaserver.h" +#if !defined(offsetof) +#include /* for definition of offsetof() */ +#endif + extern Date cheaderReadTime; /* time cheader last read in */ -#define set_header_word(tt,field,value) kawrite ((tt), ((char *)&(cheader.field) - (char *)&cheader), ((cheader.field = (value)), (char *)&(cheader.field)), sizeof(afs_int32)) +#define set_header_word(tt,field,value) kawrite ((tt), (offsetof(struct kaheader, field)), ((cheader.field = (value)), (char *)&(cheader.field)), sizeof(afs_int32)) -#define inc_header_word(tt,field) kawrite ((tt), ((char *)&(cheader.field) - (char *)&cheader), ((cheader.field = (htonl(ntohl(cheader.field)+1))), (char *)&(cheader.field)), sizeof(afs_int32)) +#define inc_header_word(tt,field) kawrite ((tt), (offsetof(struct kaheader, field)), ((cheader.field = (htonl(ntohl(cheader.field)+1))), (char *)&(cheader.field)), sizeof(afs_int32)) static int index_OK(afs_int32); @@ -411,7 +415,11 @@ ka_NewKey(struct ubik_trans *tt, afs_int32 tentryaddr, Date now = time(0); afs_int32 newkeyver; /* new key version number */ afs_int32 newtotalkeyentries = 0, oldtotalkeyentries = 0, keyentries; - int foundcurrentkey = 0, addednewkey = 0, modified; + int addednewkey = 0, modified; +#ifdef AUTH_DBM_LOG + int foundcurrentkey = 0; +#endif + es_Report("Newkey for %s.%s\n", tentry->userID.name, tentry->userID.instance); @@ -460,8 +468,8 @@ ka_NewKey(struct ubik_trans *tt, afs_int32 tentryaddr, ("Warning: Entry %s.%s contains more than one valid key: fixing\n", tentry->userID.name, tentry->userID.instance)); } -#endif foundcurrentkey = 1; +#endif } /* If we find an oldkey of the same version or diff --git a/src/kauth/kkids.c b/src/kauth/kkids.c index d004028a5..1d755274d 100644 --- a/src/kauth/kkids.c +++ b/src/kauth/kkids.c @@ -51,11 +51,8 @@ static FILE *childin, *childout; /* file pointers on pipe to kpwvalid */ static int simplify_name(char *orig_name, char *true_name) { - int thru_symlink; struct stat statbuff; - thru_symlink = 0; - #ifdef AFS_NT40_ENV if (stat(orig_name, &statbuff) < 0) { *true_name = '\0'; @@ -80,7 +77,6 @@ simplify_name(char *orig_name, char *true_name) * the contents of the link for the file name. */ if ((statbuff.st_mode & S_IFMT) == S_IFLNK) { - thru_symlink = 1; link_chars_read = readlink(orig_name, true_name, 1024); if (link_chars_read <= 0) { *true_name = '\0'; diff --git a/src/kauth/kpasswd.c b/src/kauth/kpasswd.c index c40640a70..d81cbefe9 100644 --- a/src/kauth/kpasswd.c +++ b/src/kauth/kpasswd.c @@ -218,7 +218,6 @@ CommandProc(struct cmd_syndesc *as, void *arock) struct passwd pwent; struct passwd *pw = &pwent; - int insist; /* insist on good password quality */ int lexplicit = 0; /* servers specified explicitly */ int local; /* explicit cell is same a local cell */ int foundPassword = 0; /*Not yet, anyway */ @@ -410,7 +409,6 @@ CommandProc(struct cmd_syndesc *as, void *arock) give_to_child(passwd); /* Get new password if it wasn't provided. */ - insist = 0; if (!foundNewPassword) { if (Pipe) getpipepass(npasswd, sizeof(npasswd)); diff --git a/src/libadmin/test/pts.c b/src/libadmin/test/pts.c index d4381b471..7d7a2022d 100644 --- a/src/libadmin/test/pts.c +++ b/src/libadmin/test/pts.c @@ -421,7 +421,6 @@ DoPtsUserModify(struct cmd_syndesc *as, void *arock) afs_status_t st = 0; const char *user = as->parms[USER].items->data; pts_UserUpdateEntry_t entry; - int have_quota = 0; int have_list_status_perm = 0; int have_list_groups_owned_perm = 0; int have_list_membership_perm = 0; @@ -432,7 +431,6 @@ DoPtsUserModify(struct cmd_syndesc *as, void *arock) entry.groupCreationQuota = GetIntFromString(as->parms[GROUPQUOTA].items->data, "bad quota"); entry.flag = PTS_USER_UPDATE_GROUP_CREATE_QUOTA; - have_quota = 1; } if (as->parms[LISTSTATUS].items) { diff --git a/src/libadmin/vos/vsprocs.c b/src/libadmin/vos/vsprocs.c index f313f4119..f314e018e 100644 --- a/src/libadmin/vos/vsprocs.c +++ b/src/libadmin/vos/vsprocs.c @@ -398,8 +398,7 @@ UV_MoveVolume(afs_cell_handle_p cellHandle, afs_uint32 afromvol, struct destServer destination; struct nvldbentry entry; - int islocked, pntg; - afs_int32 error; + int islocked; int same; afs_int32 store_flags; @@ -414,9 +413,7 @@ UV_MoveVolume(afs_cell_handle_p cellHandle, afs_uint32 afromvol, fromtid = 0; totid = 0; clonetid = 0; - error = 0; volid = 0; - pntg = 0; backupId = 0; newVol = 0; @@ -464,7 +461,6 @@ UV_MoveVolume(afs_cell_handle_p cellHandle, afs_uint32 afromvol, */ fromconn = UV_Bind(cellHandle, afromserver, AFSCONF_VOLUMEPORT); fromtid = 0; - pntg = 1; tst = AFSVolTransCreate(fromconn, afromvol, afrompart, ITOffline, @@ -519,7 +515,6 @@ UV_MoveVolume(afs_cell_handle_p cellHandle, afs_uint32 afromvol, } fromtid = 0; - error = 0; goto fail_UV_MoveVolume; } @@ -538,7 +533,6 @@ UV_MoveVolume(afs_cell_handle_p cellHandle, afs_uint32 afromvol, } } - pntg = 1; toconn = UV_Bind(cellHandle, atoserver, AFSCONF_VOLUMEPORT); /* get connections to the servers */ fromconn = UV_Bind(cellHandle, afromserver, AFSCONF_VOLUMEPORT); fromtid = totid = 0; /* initialize to uncreated */ @@ -2099,11 +2093,9 @@ UV_DumpVolume(afs_cell_handle_p cellHandle, afs_uint32 afromvol, afs_int32 rcode; struct nvldbentry entry; - afs_int32 error; int islocked; islocked = 0; - error = 0; rxError = 0; fromcall = (struct rx_call *)0; fromconn = (struct rx_connection *)0; @@ -2300,7 +2292,6 @@ UV_RestoreVolume(afs_cell_handle_p cellHandle, afs_int32 toserver, afs_int32 temptid; int success; struct nvldbentry entry; - afs_int32 error; int islocked; struct restoreCookie cookie; int reuseID; @@ -2311,7 +2302,6 @@ UV_RestoreVolume(afs_cell_handle_p cellHandle, afs_int32 toserver, memset(&cookie, 0, sizeof(cookie)); islocked = 0; success = 0; - error = 0; reuseID = 1; tocall = (struct rx_call *)0; toconn = (struct rx_connection *)0; @@ -3519,7 +3509,6 @@ CheckVldb(afs_cell_handle_p cellHandle, struct nvldbentry *entry, int islocked = 0; int pass = 0; afs_int32 modentry = 0; - afs_int32 delentry = 0; if (modified) { *modified = 0; @@ -3583,7 +3572,6 @@ CheckVldb(afs_cell_handle_p cellHandle, struct nvldbentry *entry, if (tst) { goto fail_CheckVldb; } - delentry = 1; } else { /* Replace old entry with our new one */ if (!VLDB_ReplaceEntry @@ -3626,7 +3614,6 @@ UV_SyncServer(afs_cell_handle_p cellHandle, struct rx_connection *server, { int rc = 0; afs_status_t tst = 0; - afs_int32 code, vcode; int noError; afs_int32 nentries, tentries = 0; struct VldbListByAttributes attributes; @@ -3637,8 +3624,6 @@ UV_SyncServer(afs_cell_handle_p cellHandle, struct rx_connection *server, afs_int32 si, nsi; afs_int32 modified = 0; - code = 0; - vcode = 0; noError = 1; arrayEntries.nbulkentries_val = 0; @@ -3701,14 +3686,13 @@ UV_RenameVolume(afs_cell_handle_p cellHandle, struct nvldbentry *entry, int rc = 0; afs_status_t tst = 0; afs_status_t etst = 0; - afs_int32 rcode, error; + afs_int32 rcode; int i, index; char nameBuffer[256]; afs_int32 tid; struct rx_connection *aconn; int islocked; - error = 0; aconn = (struct rx_connection *)0; tid = 0; islocked = 0; @@ -4065,12 +4049,10 @@ int UV_VolumeZap(afs_cell_handle_p cellHandle, struct rx_connection *server, unsigned int partition, afs_uint32 volumeId, afs_status_p st) { - afs_int32 rcode, ttid, error, code; + afs_int32 rcode, ttid; int rc = 0; afs_status_t tst = 0; - code = 0; - error = 0; ttid = 0; tst = AFSVolTransCreate(server, volumeId, partition, ITOffline, &ttid); diff --git a/src/ptserver/db_verify.c b/src/ptserver/db_verify.c index e99863902..0e7676533 100644 --- a/src/ptserver/db_verify.c +++ b/src/ptserver/db_verify.c @@ -536,17 +536,13 @@ WalkNextChain(char map[], /* one byte per db entry */ if (id == PRBADID) continue; else if (id) { - int eid_s, id_s; + int id_s; sgcount++; /* in case the ids are large, convert to pure sign. */ if (id > 0) id_s = 1; else id_s = -1; - if (eid > 0) - eid_s = 1; - else - eid_s = -1; if (id_s > 0) { fprintf(stderr, "User can't be member of supergroup list\n"); diff --git a/src/rxgen/rpc_parse.c b/src/rxgen/rpc_parse.c index a88a069a9..a19ca5489 100644 --- a/src/rxgen/rpc_parse.c +++ b/src/rxgen/rpc_parse.c @@ -1658,11 +1658,6 @@ ss_ProcTail_setup(definition * defp, int somefrees) for (plist = defp->pc.plists; plist; plist = plist->next) { if (plist->component_kind == DEF_PARAM && (plist->pl.param_flag & FREETHIS_PARAM)) { - char *dot = "", *extens = ""; - if (plist->pl.string_name) { - dot = "."; - extens = plist->pl.string_name; - } f_print(fout, "\tif (!%s) goto fail1;\n", plist->scode); } } diff --git a/src/rxkad/v5gen.c b/src/rxkad/v5gen.c index fe8ab6b19..eb576fbb6 100644 --- a/src/rxkad/v5gen.c +++ b/src/rxkad/v5gen.c @@ -14,9 +14,8 @@ encode_krb5int32(unsigned char *p, size_t len, const krb5int32 * data, size_t * { size_t ret = 0; size_t l; - int i, e; + int e; - i = 0; e = der_put_integer(p, len, data, &l); if (e) return e; @@ -117,9 +116,8 @@ encode_Ticket(unsigned char *p, size_t len, const Ticket * data, size_t * size) { size_t ret = 0; size_t l; - int i, e; + int e; - i = 0; /* enc-part */ { size_t Top_tag_tag_oldret = ret; @@ -460,9 +458,8 @@ encode_AuthorizationDataElement(unsigned char *p, size_t len, const Authorizatio { size_t ret = 0; size_t l; - int i, e; + int e; - i = 0; /* ad-data */ { size_t Top_tag_oldret = ret; @@ -691,9 +688,8 @@ encode_EncryptedData(unsigned char *p, size_t len, const EncryptedData * data, s { size_t ret = 0; size_t l; - int i, e; + int e; - i = 0; /* cipher */ { size_t Top_tag_oldret = ret; @@ -1463,9 +1459,8 @@ encode_HostAddress(unsigned char *p, size_t len, const HostAddress * data, size_ { size_t ret = 0; size_t l; - int i, e; + int e; - i = 0; /* address */ { size_t Top_tag_oldret = ret; @@ -1890,9 +1885,8 @@ encode_EncTicketPart(unsigned char *p, size_t len, const EncTicketPart * data, s { size_t ret = 0; size_t l; - int i, e; + int e; - i = 0; /* authorization-data */ if ((data)->authorization_data) { size_t Top_tag_tag_oldret = ret; @@ -2692,9 +2686,8 @@ encode_KerberosTime(unsigned char *p, size_t len, const KerberosTime * data, siz { size_t ret = 0; size_t l; - int i, e; + int e; - i = 0; e = der_put_generalized_time(p, len, data, &l); if (e) return e; @@ -2795,9 +2788,8 @@ encode_TransitedEncoding(unsigned char *p, size_t len, const TransitedEncoding * { size_t ret = 0; size_t l; - int i, e; + int e; - i = 0; /* contents */ { size_t Top_tag_oldret = ret; @@ -3026,9 +3018,8 @@ encode_EncryptionKey(unsigned char *p, size_t len, const EncryptionKey * data, s { size_t ret = 0; size_t l; - int i, e; + int e; - i = 0; /* keyvalue */ { size_t Top_tag_oldret = ret; @@ -3257,9 +3248,8 @@ encode_TicketFlags(unsigned char *p, size_t len, const TicketFlags * data, size_ { size_t ret = 0; size_t l; - int i, e; + int e; - i = 0; { unsigned char c = 0; if (len < 1) @@ -3519,9 +3509,8 @@ encode_Realm(unsigned char *p, size_t len, const Realm * data, size_t * size) { size_t ret = 0; size_t l; - int i, e; + int e; - i = 0; e = der_put_general_string(p, len, data, &l); if (e) return e; @@ -3627,9 +3616,8 @@ encode_ENCTYPE(unsigned char *p, size_t len, const ENCTYPE * data, size_t * size { size_t ret = 0; size_t l; - int i, e; + int e; - i = 0; { int enumint = (int) *data; e = der_put_integer(p, len, &enumint, &l); @@ -3741,9 +3729,8 @@ encode_NAME_TYPE(unsigned char *p, size_t len, const NAME_TYPE * data, size_t * { size_t ret = 0; size_t l; - int i, e; + int e; - i = 0; { int enumint = (int) *data; e = der_put_integer(p, len, &enumint, &l); diff --git a/src/scout/scout.c b/src/scout/scout.c index 9877ae1ce..2c2b392bf 100644 --- a/src/scout/scout.c +++ b/src/scout/scout.c @@ -1031,7 +1031,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 */ @@ -1087,13 +1086,13 @@ mini_PrintDiskStats(struct mini_line *a_srvline, used_disk_idx, diskdata->label); fflush(scout_debugfd); } - code = mini_justify(" ", /*Src buffer */ + 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); + 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); @@ -1199,14 +1198,14 @@ mini_PrintDiskStats(struct mini_line *a_srvline, rn, s, found_idx, diskdata->label); fflush(scout_debugfd); } - code = mini_justify(s, /*Src buffer */ + 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 */ } diff --git a/src/ubik/recovery.c b/src/ubik/recovery.c index f0b09ae63..b17d05482 100644 --- a/src/ubik/recovery.c +++ b/src/ubik/recovery.c @@ -453,7 +453,7 @@ urecovery_Interact(void *dummy) struct ubik_server *bestServer = NULL; struct ubik_server *ts; int dbok, doingRPC, now; - afs_int32 lastProbeTime, lastDBVCheck; + afs_int32 lastProbeTime; /* if we're the sync site, the best db version we've found yet */ static struct ubik_version bestDBVersion; struct ubik_version tversion; @@ -466,14 +466,13 @@ urecovery_Interact(void *dummy) char hoststr[16]; #ifndef OLD_URECOVERY char pbuffer[1028]; - int flen, fd = -1; + int fd = -1; afs_int32 pass; #endif /* otherwise, begin interaction */ urecovery_state = 0; lastProbeTime = 0; - lastDBVCheck = 0; while (1) { /* Run through this loop every 4 seconds */ tv.tv_sec = 4; @@ -552,7 +551,6 @@ urecovery_Interact(void *dummy) */ urecovery_state &= ~UBIK_RECHAVEDB; } - lastDBVCheck = FT_ApproxTime(); urecovery_state |= UBIK_RECFOUNDDB; urecovery_state &= ~UBIK_RECSENTDB; } @@ -616,7 +614,6 @@ urecovery_Interact(void *dummy) goto FetchEndCall; } #ifndef OLD_URECOVERY - flen = length; afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB%s%d.TMP", ubik_dbase->pathName, (file<0)?"SYS":"", (file<0)?-file:file); fd = open(pbuffer, O_CREAT | O_RDWR | O_TRUNC, 0600); if (fd < 0) { diff --git a/src/ubik/remote.c b/src/ubik/remote.c index 9fa996d35..a669da2ea 100644 --- a/src/ubik/remote.c +++ b/src/ubik/remote.c @@ -487,7 +487,7 @@ SDISK_SendFile(struct rx_call *rxcall, afs_int32 file, char hoststr[16]; #ifndef OLD_URECOVERY char pbuffer[1028]; - int flen, fd = -1; + int fd = -1; afs_int32 epoch = 0; afs_int32 pass; #endif @@ -537,7 +537,6 @@ SDISK_SendFile(struct rx_call *rxcall, afs_int32 file, tversion.epoch = 0; /* start off by labelling in-transit db as invalid */ (*dbase->setlabel) (dbase, file, &tversion); /* setlabel does sync */ #ifndef OLD_URECOVERY - flen = length; afs_snprintf(pbuffer, sizeof(pbuffer), "%s.DB%s%d.TMP", ubik_dbase->pathName, (file<0)?"SYS":"", (file<0)?-file:file); fd = open(pbuffer, O_CREAT | O_RDWR | O_TRUNC, 0600); if (fd < 0) { diff --git a/src/update/server.c b/src/update/server.c index a7fc60ff5..7c44ab9e9 100644 --- a/src/update/server.c +++ b/src/update/server.c @@ -249,10 +249,8 @@ main(int argc, char *argv[]) usage: Quit("Usage: upserver [+] [-crypt +] [-clear +] [-auth +] [-rxbind] [-help]\n"); } else { - int dirlen; if (nDirs >= sizeof(dirName) / sizeof(dirName[0])) Quit("Too many dirs"); - dirlen = strlen(argv[a]); if (AddObject(&dirName[nDirs], argv[a])) { printf("%s: Unable to export dir %s. Skipping\n", whoami, argv[a]); diff --git a/src/uss/uss.c b/src/uss/uss.c index f5517150c..1163fc126 100644 --- a/src/uss/uss.c +++ b/src/uss/uss.c @@ -1792,7 +1792,6 @@ main(int argc, char *argv[]) { /*Main routine */ struct cmd_syndesc *cs; /*Command line syntax descriptor */ - afs_int32 code; /*Return code */ #ifdef AFS_AIX32_ENV /* @@ -1979,7 +1978,7 @@ main(int argc, char *argv[]) /* * Execute the parsed command. */ - code = cmd_Dispatch(argc, argv); + cmd_Dispatch(argc, argv); #if 0 if (code) { fprintf(stderr, "%s: Call to cmd_Dispatch() failed; code is %d\n", @@ -1988,7 +1987,7 @@ main(int argc, char *argv[]) } #endif /* 0 */ if (doUnlog) { - code = uss_fs_UnlogToken(uss_Cell); + uss_fs_UnlogToken(uss_Cell); } return 0; } /*Main routine */ diff --git a/src/uss/uss_acl.c b/src/uss/uss_acl.c index 9ed9aebe4..30a696eaa 100644 --- a/src/uss/uss_acl.c +++ b/src/uss/uss_acl.c @@ -672,7 +672,6 @@ uss_acl_SetDiskQuota(char *a_path, int a_q) static char rn[] = "uss_acl_SetDiskQuota"; #endif uss_VolumeStatus_t *status; - char *name, *motd, *offmsg; char *input; char tmp_str[AFS_PIOCTL_MAXSIZE]; @@ -683,7 +682,6 @@ uss_acl_SetDiskQuota(char *a_path, int a_q) status = (uss_VolumeStatus_t *) tmp_str; status->MinQuota = status->MaxQuota = -1; - name = motd = offmsg = NULL; status->MaxQuota = a_q; input = (char *)status + sizeof(*status); diff --git a/src/venus/fs.c b/src/venus/fs.c index 7439028cb..5ffa27b5d 100644 --- a/src/venus/fs.c +++ b/src/venus/fs.c @@ -2367,10 +2367,8 @@ CallBackRxConnCmd(struct cmd_syndesc *as, void *arock) struct cmd_item *ti; afs_int32 hostAddr; struct hostent *thp; - int setp; ti = as->parms[0].items; - setp = 1; if (ti) { thp = hostutil_GetHostByName(ti->data); if (!thp) { @@ -2380,7 +2378,6 @@ CallBackRxConnCmd(struct cmd_syndesc *as, void *arock) else memcpy(&hostAddr, thp->h_addr, sizeof(afs_int32)); } else { hostAddr = 0; /* means don't set host */ - setp = 0; /* aren't setting host */ } /* now do operation */ @@ -2751,7 +2748,7 @@ ExportAfsCmd(struct cmd_syndesc *as, void *arock) afs_int32 code; struct ViceIoctl blob; struct cmd_item *ti; - int export = 0, type = 0, mode = 0, exp = 0, exportcall, pwsync = + int export = 0, type = 0, mode = 0, exportcall, pwsync = 0, smounts = 0, clipags = 0, pagcb = 0; ti = as->parms[0].items; @@ -2773,7 +2770,6 @@ ExportAfsCmd(struct cmd_syndesc *as, void *arock) fprintf(stderr, "Illegal argument %s\n", ti->data); return 1; } - exp = 1; } if ((ti = as->parms[2].items)) { /* -noconvert */ if (strcmp(ti->data, "on") == 0) @@ -4083,12 +4079,10 @@ FlushMountCmd(struct cmd_syndesc *as, void *arock) char *last_component; /*Last component of true name */ struct stat statbuff; /*Buffer for status info */ int link_chars_read; /*Num chars read in readlink() */ - int thru_symlink; /*Did we get to a mount point via a symlink? */ int error = 0; for (ti = as->parms[0].items; ti; ti = ti->next) { /* once per file */ - thru_symlink = 0; sprintf(orig_name, "%s%s", (ti->data[0] == '/') ? "" : "./", ti->data); @@ -4104,7 +4098,6 @@ FlushMountCmd(struct cmd_syndesc *as, void *arock) * the file name with the link name. */ if ((statbuff.st_mode & S_IFMT) == S_IFLNK) { - thru_symlink = 1; /* * Read name of resolved file. */ diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index e09a96820..cf0dd0b65 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -1247,7 +1247,7 @@ RXStore_AccessList(Vnode * targetptr, struct AFSOpaque *AccessList) static int CopyOnWrite(Vnode * targetptr, Volume * volptr, afs_foff_t off, afs_fsize_t len) { - Inode ino, nearInode; + Inode ino, nearInode AFS_UNUSED; ssize_t rdlen; ssize_t wrlen; afs_fsize_t size; @@ -1824,7 +1824,7 @@ Alloc_NewVnode(Vnode * parentptr, DirHandle * dir, Volume * volptr, Error errorCode = 0; /* Error code returned back */ Error temp; Inode inode = 0; - Inode nearInode; /* hint for inode allocation in solaris */ + Inode nearInode AFS_UNUSED; /* hint for inode allocation in solaris */ afs_ino_str_t stmp; if ((errorCode = @@ -6019,7 +6019,7 @@ SRXAFS_XStatsVersion(struct rx_call * a_call, afs_int32 * a_versionP) static void FillPerfValues(struct afs_PerfStats *a_perfP) { /*FillPerfValues */ - afs_uint32 hi, lo; + afs_uint32 hi AFS_UNUSED, lo; int dir_Buffers; /*# buffers in use by dir package */ int dir_Calls; /*# read calls in dir package */ int dir_IOs; /*# I/O ops in dir package */ diff --git a/src/vol/fssync-server.c b/src/vol/fssync-server.c index a9ba3789b..8678fd59d 100644 --- a/src/vol/fssync-server.c +++ b/src/vol/fssync-server.c @@ -332,14 +332,16 @@ FSYNC_sync(void * args) CallHandler(FSYNC_readfds, nfds, POLLIN|POLLPRI); #else int maxfd; +#ifdef AFS_PTHREAD_ENV struct timeval s_timeout; +#endif GetHandler(&FSYNC_readfds, &maxfd); - s_timeout.tv_sec = SYNC_SELECT_TIMEOUT; - s_timeout.tv_usec = 0; /* Note: check for >= 1 below is essential since IOMGR_select * doesn't have exactly same semantics as select. */ #ifdef AFS_PTHREAD_ENV + s_timeout.tv_sec = SYNC_SELECT_TIMEOUT; + s_timeout.tv_usec = 0; if (select(maxfd + 1, &FSYNC_readfds, NULL, NULL, &s_timeout) >= 1) #else /* AFS_PTHREAD_ENV */ if (IOMGR_Select(maxfd + 1, &FSYNC_readfds, NULL, NULL, NULL) >= 1) diff --git a/src/vol/vol-salvage.c b/src/vol/vol-salvage.c index e21630c9e..21b419884 100644 --- a/src/vol/vol-salvage.c +++ b/src/vol/vol-salvage.c @@ -2580,7 +2580,6 @@ SalvageIndex(struct SalvInfo *salvinfo, Inode ino, VnodeClass class, int RW, struct ViceInodeInfo *ip, int nInodes, struct VolumeSummary *volSummary, int check) { - VolumeId volumeNumber; char buf[SIZEOF_LARGEDISKVNODE]; struct VnodeDiskObject *vnode = (struct VnodeDiskObject *)buf; int err = 0; @@ -2594,7 +2593,6 @@ SalvageIndex(struct SalvInfo *salvinfo, Inode ino, VnodeClass class, int RW, IHandle_t *handle; FdHandle_t *fdP; - volumeNumber = volSummary->header.id; IH_INIT(handle, salvinfo->fileSysDevice, volSummary->header.parent, ino); fdP = IH_OPEN(handle); osi_Assert(fdP != NULL); @@ -3685,7 +3683,7 @@ CreateRootDir(struct SalvInfo *salvinfo, VolumeDiskData *volHeader, Inode *ip; afs_sfsize_t bytes; struct VnodeEssence *vep; - Inode readmeinode; + Inode readmeinode = 0; time_t now = time(NULL); if (!salvinfo->vnodeInfo[vLarge].vnodes && !salvinfo->vnodeInfo[vSmall].vnodes) { diff --git a/src/vol/volume.c b/src/vol/volume.c index fca12561c..e11e6c4d1 100644 --- a/src/vol/volume.c +++ b/src/vol/volume.c @@ -3139,11 +3139,11 @@ attach2(Error * ec, VolId volumeId, char *path, struct DiskPartition64 *partp, /* have we read in the header successfully? */ int read_header = 0; +#ifdef AFS_DEMAND_ATTACH_FS /* should we FreeVolume(vp) instead of VCheckFree(vp) in the error * cleanup? */ int forcefree = 0; -#ifdef AFS_DEMAND_ATTACH_FS /* in the case of an error, to what state should the volume be * transitioned? */ VolState error_state = VOL_STATE_ERROR; @@ -3330,10 +3330,10 @@ attach2(Error * ec, VolId volumeId, char *path, struct DiskPartition64 *partp, VRequestSalvage_r(ec, vp, SALVSYNC_ERROR, VOL_SALVAGE_NO_OFFLINE); VChangeState_r(vp, VOL_STATE_ERROR); vp->nUsers = 0; + forcefree = 1; #endif /* AFS_DEMAND_ATTACH_FS */ Log("VAttachVolume: volume %s is junk; it should be destroyed at next salvage\n", path); *ec = VNOVOL; - forcefree = 1; goto locked_error; } @@ -4470,12 +4470,12 @@ VOffline(Volume * vp, char *message) void VDetachVolume_r(Error * ec, Volume * vp) { +#ifdef FSSYNC_BUILD_CLIENT VolumeId volume; struct DiskPartition64 *tpartp; int notifyServer = 0; int useDone = FSYNC_VOL_ON; - *ec = 0; /* always "succeeds" */ if (VCanUseFSSYNC()) { notifyServer = vp->needsPutBack; if (V_destroyMe(vp) == DESTROY_ME) @@ -4493,6 +4493,8 @@ VDetachVolume_r(Error * ec, Volume * vp) # endif tpartp = vp->partition; volume = V_id(vp); +#endif /* FSSYNC_BUILD_CLIENT */ + *ec = 0; /* always "succeeds" */ DeleteVolumeFromHashTable(vp); vp->shuttingDown = 1; #ifdef AFS_DEMAND_ATTACH_FS @@ -8632,7 +8634,7 @@ VVByPListWait_r(struct DiskPartition64 * dp) void VPrintCacheStats_r(void) { - afs_uint32 get_hi, get_lo, load_hi, load_lo; + afs_uint32 get_hi AFS_UNUSED, get_lo, load_hi AFS_UNUSED, load_lo; struct VnodeClassInfo *vcp; vcp = &VnodeClassInfo[vLarge]; Log("Large vnode cache, %d entries, %d allocs, %d gets (%d reads), %d writes\n", vcp->cacheSize, vcp->allocs, vcp->gets, vcp->reads, vcp->writes); diff --git a/src/vol/vutil.c b/src/vol/vutil.c index acda92a31..7b2cd8b23 100644 --- a/src/vol/vutil.c +++ b/src/vol/vutil.c @@ -136,7 +136,7 @@ VCreateVolume_r(Error * ec, char *partname, VolId volumeId, VolId parentId) struct VolumeDiskHeader diskHeader; IHandle_t *handle; FdHandle_t *fdP; - Inode nearInode = 0; + Inode nearInode AFS_UNUSED = 0; char *part, *name; struct stat st; afs_ino_str_t stmp; diff --git a/src/volser/dumpstuff.c b/src/volser/dumpstuff.c index caa2c408c..53aa8b8d0 100644 --- a/src/volser/dumpstuff.c +++ b/src/volser/dumpstuff.c @@ -1312,7 +1312,7 @@ ReadVnodes(struct iod *iodp, Volume * vp, int incremental, struct VnodeClassInfo *vcp; IHandle_t *tmpH; FdHandle_t *fdP; - Inode nearInode; + Inode nearInode AFS_UNUSED; afs_int32 critical = 0; tag = iod_getc(iodp); diff --git a/src/volser/restorevol.c b/src/volser/restorevol.c index f8f198e53..86d720edc 100644 --- a/src/volser/restorevol.c +++ b/src/volser/restorevol.c @@ -147,7 +147,7 @@ ReadDumpHeader(struct DumpHeader *dh) { int i, done; char tag, c; - afs_int32 magic; + afs_int32 magic AFS_UNUSED; /* memset(&dh, 0, sizeof(dh)); */ diff --git a/src/volser/vol_split.c b/src/volser/vol_split.c index 7522b9bb3..d486e2487 100644 --- a/src/volser/vol_split.c +++ b/src/volser/vol_split.c @@ -404,7 +404,7 @@ afs_int32 copyVnodes(struct Msg *m, Volume *vol, Volume *newvol, ino = VNDISK_GET_INO(vnode); if (ino) { IHandle_t *h, *newh; - Inode nearInode; + Inode nearInode AFS_UNUSED; #if defined(NEARINODE_HINT) && !defined(AFS_NAMEI_ENV) V_pref(vol,nearInode) #endif diff --git a/src/volser/volprocs.c b/src/volser/volprocs.c index c18db508a..8d1ad7fb6 100644 --- a/src/volser/volprocs.c +++ b/src/volser/volprocs.c @@ -342,7 +342,7 @@ ViceCreateRoot(Volume *vp) DirHandle dir; struct acl_accessList *ACL; AFSFid did; - Inode inodeNumber, nearInode; + Inode inodeNumber, nearInode AFS_UNUSED; struct VnodeDiskObject *vnode; struct VnodeClassInfo *vcp = &VnodeClassInfo[vLarge]; IHandle_t *h; diff --git a/src/xstat/xstat_fs_test.c b/src/xstat/xstat_fs_test.c index 3be314e41..ba9677b57 100644 --- a/src/xstat/xstat_fs_test.c +++ b/src/xstat/xstat_fs_test.c @@ -279,14 +279,6 @@ PrintOverallPerfInfo(struct afs_PerfStats *a_ovP) void PrintOpTiming(int a_opIdx, struct fs_stats_opTimingData *a_opTimeP) { - double fSumTime, avg; - - fSumTime = - ((double)(a_opTimeP->sumTime.tv_sec)) + - (((double)(a_opTimeP->sumTime.tv_usec)) / ((double)(1000000))); -/* printf("Double sum time is %f\n", fSumTime);*/ - avg = fSumTime / ((double)(a_opTimeP->numSuccesses)); - printf ("%15s: %u ops (%u OK); sum=%lu.%06lu, sqr=%lu.%06lu, min=%lu.%06lu, max=%lu.%06lu\n", opNames[a_opIdx], a_opTimeP->numOps, a_opTimeP->numSuccesses, @@ -320,14 +312,6 @@ PrintOpTiming(int a_opIdx, struct fs_stats_opTimingData *a_opTimeP) void PrintXferTiming(int a_opIdx, struct fs_stats_xferData *a_xferP) { - double fSumTime, avg; - - fSumTime = - ((double)(a_xferP->sumTime.tv_sec)) + - ((double)(a_xferP->sumTime.tv_usec)) / ((double)(1000000)); - - avg = fSumTime / ((double)(a_xferP->numSuccesses)); - printf ("%s: %u xfers (%u OK), time sum=%lu.%06lu, sqr=%lu.%06lu, min=%lu.%06lu, max=%lu.%06lu\n", xferOpNames[a_opIdx], a_xferP->numXfers, a_xferP->numSuccesses, -- 2.39.5