From cd341e2fd7e621a929cad9ac2e722f5178902266 Mon Sep 17 00:00:00 2001 From: Chaskiel M Grundman Date: Sun, 3 Sep 2006 06:32:33 +0000 Subject: [PATCH] nuke-do-not-pass-null-rock-20060903 don't pass a null rock inot nuke(), fixing earlier introduced bug --- src/vol/nuke.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/vol/nuke.c b/src/vol/nuke.c index 5b52e46a0..8c6ff93b9 100644 --- a/src/vol/nuke.c +++ b/src/vol/nuke.c @@ -73,7 +73,7 @@ struct ilist { * Note that ainfo->u.param[0] is always the volume ID, for any vice inode. */ static int -NukeProc(struct ViceInodeInfo *ainfo, afs_int32 avolid, struct ilist *allInodes) +NukeProc(struct ViceInodeInfo *ainfo, afs_int32 avolid, struct ilist **allInodes) { struct ilist *ti; register afs_int32 i; @@ -86,13 +86,13 @@ NukeProc(struct ViceInodeInfo *ainfo, afs_int32 avolid, struct ilist *allInodes) if (ainfo->u.param[0] != avolid) return 0; /* don't want this one */ /* record the info */ - if (!allInodes || allInodes->freePtr >= MAXATONCE) { + if (!*allInodes || (*allInodes)->freePtr >= MAXATONCE) { ti = (struct ilist *)malloc(sizeof(struct ilist)); memset(ti, 0, sizeof(*ti)); - ti->next = allInodes; - allInodes = ti; + ti->next = *allInodes; + *allInodes = ti; } else - ti = allInodes; /* use the one with space */ + ti = *allInodes; /* use the one with space */ i = ti->freePtr++; /* find our slot in this mess */ ti->inode[i] = ainfo->inodeNumber; ti->count[i] = ainfo->linkCount; @@ -171,11 +171,11 @@ nuke(char *aname, afs_int32 avolid) #ifdef AFS_NAMEI_ENV code = ListViceInodes(lastDevComp, aname, NULL, NukeProc, avolid, &forceSal, - 0, wpath, allInodes); + 0, wpath, &allInodes); #else code = ListViceInodes(lastDevComp, aname, "/tmp/vNukeXX", NukeProc, avolid, - &forceSal, 0, wpath, allInodes); + &forceSal, 0, wpath, &allInodes); unlink("/tmp/vNukeXX"); /* clean it up now */ #endif if (code == 0) { -- 2.39.5