uafs_LookupName(char *path, struct usr_vnode *parentVp,
struct usr_vnode **vpp, int follow, int no_eval_mtpt)
{
- int code;
+ int code = 0;
int linkCount;
struct usr_vnode *vp;
struct usr_vnode *nextVp;
}
}
afs_PutVolume(tvp, READ_LOCK);
+ for (i = 0; i < MAXHOSTS; i++) {
+ if (tvp->serverHost[i] && areq->skipserver[i] == 0) {
+ serversleft = 1;
+ break;
+ }
+ }
+ return serversleft;
}
}
- for (i = 0; i < MAXHOSTS; i++) {
- if (tvp->serverHost[i] && areq->skipserver[i] == 0) {
- serversleft = 1;
- break;
- }
- }
- return serversleft;
+ return 1;
}
char *
ka_LocalCell(void)
{
- int code;
+ int code = 0;
LOCK_GLOBAL_MUTEX;
if (conf) {
{
char oldpassword[512];
char password[512];
- int rc;
+ int rc = 1;
if (fgets(oldpassword, 512, stdin))
while (fgets(password, 512, stdin)) {
struct prentry c; /* continuation entry */
afs_int32 na; /* next thread */
int ni;
- afs_int32 eid;
- int count; /* number of members */
+ afs_int32 eid = 0;
+ int count = 0; /* number of members, set to > 9999 if */
+ /* list ends early */
int i;
int noErrors = 1;
int length; /* length of chain */
head = ntohl(e->next);
eid = ntohl(e->id);
bit = MAP_CONT;
- count = 0; /* set to >9999 if list ends early */
#if defined(SUPERGROUPS)
sgcount = 0;
sghead = ntohl(g->next);
struct prentry c; /* continuation entry */
afs_int32 na; /* next thread */
int ni;
- afs_int32 eid;
+ afs_int32 eid = 0;
int length; /* length of chain */
if (e) {
CommandProc(register struct cmd_syndesc *a_as, void *arock)
{
register int i;
- register long code;
- long cc, upos, gpos;
+ long code = 0;
+ long cc, upos;
+ long gpos = 0;
struct prentry uentry, gentry;
struct ubik_hdr *uh;
char *dfile = 0;
struct ubik_version *avers;
{
register afs_int32 code;
- register struct ubik_dbase *dbase;
+ struct ubik_dbase *dbase = NULL;
char tbuffer[1024];
afs_int32 offset;
struct ubik_version tversion;
register int tlen;
struct rx_peer *tpeer;
struct rx_connection *tconn;
- afs_uint32 otherHost;
+ afs_uint32 otherHost = 0;
#ifndef OLD_URECOVERY
char pbuffer[1028];
int flen, fd = -1;
- afs_int32 epoch, pass;
+ afs_int32 epoch = 0;
+ afs_int32 pass;
#endif
/* send the file back to the requester */
#ifndef OLD_URECOVERY
unlink(pbuffer);
/* Failed to sync. Allow reads again for now. */
- tversion.epoch = epoch;
- (*dbase->setlabel) (dbase, file, &tversion);
+ if (dbase != NULL) {
+ tversion.epoch = epoch;
+ (*dbase->setlabel) (dbase, file, &tversion);
+ }
#endif
ubik_print
("Ubik: Synchronize database with server %s failed (error = %d)\n",
h_Enumerate_r(int (*proc) (), struct host *enumstart, char *param)
{
register struct host *host, *next;
- register int held, nheld;
+ int held = 0;
+ int nheld = 0;
if (hostCount == 0) {
return;
h_FindClient_r(struct rx_connection *tcon)
{
register struct client *client;
- register struct host *host;
+ struct host *host = NULL;
struct client *oldClient;
- afs_int32 viceid;
+ afs_int32 viceid = 0;
afs_int32 expTime;
afs_int32 code;
int authClass;
int
h_DeleteHostFromAddrHashTable_r(afs_uint32 addr, afs_uint16 port, struct host *host)
{
- int flag;
+ int flag = 0;
register struct h_AddrHashChain **hp, *th;
for (hp = &hostAddrHashTable[h_HashIndex(addr)]; (th = *hp);) {
int freecount = 0, mhcount = 0, vlcount = 0;
int rwcount = 0, rocount = 0, bkcount = 0;
struct nvlentry vlentry;
- afs_uint32 addr, entrysize, maxvolid = 0;
+ afs_uint32 addr;
+ afs_uint32 entrysize = 0;
+ afs_uint32 maxvolid = 0;
if (verbose)
printf("Read each entry in the database\n");
entrysize = VL_ADDREXTBLK_SIZE;
mhcount++;
} else {
- printf("Unknown entry at %u\n", addr);
+ printf("Unknown entry at %u. Aborting\n", addr);
+ break;
}
}
if (verbose) {
if (verbose)
printf("Verify each volume entry\n");
for (i = 0; i < maxentries; i++) {
- int nextp;
- int reft;
- int hash, nexthash = 0;
- int *nextpp;
- char *which;
+ int nextp = 0;
+ int reft = 0;
+ int hash = 0;
+ int nexthash = 0;
+ int *nextpp = NULL;
+ char *which = NULL;
if (record[i].type == 0)
continue;
StreamHandle_t *
stream_open(const char *filename, const char *mode)
{
- FD_t fd;
+ FD_t fd = INVALID_FD;
if (strcmp(mode, "r") == 0) {
fd = OS_OPEN(filename, O_RDONLY, 0);
void
GetVolumeSummary(VolumeId singleVolumeNumber)
{
- DIR *dirp;
+ DIR *dirp = NULL;
afs_int32 nvols = 0;
struct VolumeSummary *vsp, vs;
struct VolumeDiskHeader diskHeader;
int check;
Inode ino;
int dec_VGLinkH = 0;
- int VGLinkH_p1;
+ int VGLinkH_p1 =0;
FdHandle_t *fdP = NULL;
VGLinkH_cnt = 0;
{
VolumeId volume;
struct DiskPartition64 *tpartp;
- int notifyServer, useDone = FSYNC_VOL_ON;
+ int notifyServer = 0;
+ int useDone = FSYNC_VOL_ON;
*ec = 0; /* always "succeeds" */
if (programType == volumeUtility) {
{
afs_int32 volid;
struct volser_status tstatus;
- int code, rcode, tcode;
+ int code = 0;
+ int rcode, tcode;
char hoststr[16];
*connPtr = (struct rx_connection *)0;
afs_int32 afrompart, int forceflag)
{
char vname[64];
- afs_int32 code, vcode, rcode, tcode;
+ afs_int32 code = 0;
+ afs_int32 vcode, rcode, tcode;
afs_int32 cloneVolId, roVolId;
struct replica *replicas = 0;
struct nvldbentry entry, storeEntry;
int islocked = 0;
afs_int32 clonetid = 0, onlinetid;
afs_int32 fromtid = 0;
- afs_uint32 fromdate, thisdate;
+ afs_uint32 fromdate = 0;
+ afs_uint32 thisdate;
time_t tmv;
int s;
manyDests tr;
manyResults results;
int rwindex, roindex, roclone, roexists;
- afs_int32 rwcrdate, rwupdate, clcrdate;
+ afs_int32 rwcrdate = 0;
+ afs_int32 rwupdate, clcrdate;
struct rtime {
int validtime;
afs_uint32 uptime;
CheckVolume(volintInfo * volumeinfo, afs_int32 aserver, afs_int32 apart,
afs_int32 * modentry, afs_uint32 * maxvolid)
{
- int idx, j;
+ int idx = 0;
+ int j;
afs_int32 code, error = 0;
struct nvldbentry entry, storeEntry;
char pname[10];
{
struct rx_connection *aconn = 0;
afs_int32 j, k, code, vcode, error = 0;
- afs_int32 tverbose, mod, modified = 0;
+ afs_int32 tverbose;
+ afs_int32 mod, modified = 0;
struct nvldbentry vldbentry;
afs_int32 volumeid = 0;
volEntries volumeInfo;
volumeInfo.volEntries_val = (volintInfo *) 0;
volumeInfo.volEntries_len = 0;
- if (!aserver && (flags & 1)) {
- /* fprintf(STDERR,"Partition option requires a server option\n"); */
- ERROR_EXIT(EINVAL);
- }
-
/* Turn verbose logging off and do our own verbose logging */
+ /* tverbose must be set before we call ERROR_EXIT() */
+
tverbose = verbose;
if (flags & 2)
tverbose = 1;
verbose = 0;
+ if (!aserver && (flags & 1)) {
+ /* fprintf(STDERR,"Partition option requires a server option\n"); */
+ ERROR_EXIT(EINVAL);
+ }
+
/* Read the VLDB entry */
vcode = VLDB_GetEntryByName(avolname, &vldbentry);
if (vcode && (vcode != VL_NOENT)) {