vol: dead initialization in VWalkVolumeHeaders()
authorGarrett Wollman <wollman@csail.mit.edu>
Sun, 15 Jul 2012 19:44:42 +0000 (15:44 -0400)
committerDerrick Brashear <shadow@dementix.org>
Mon, 16 Jul 2012 12:49:32 +0000 (05:49 -0700)
Actually, all of the initializers in this small function are dead.

Change-Id: If89fe3222ec39b34233f92f3aafd458f5723b0c5
Reviewed-on: http://gerrit.openafs.org/7771
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

src/vol/vutil.c

index 007b1ec..3407d5a 100644 (file)
@@ -827,8 +827,8 @@ int
 VWalkVolumeHeaders(struct DiskPartition64 *dp, const char *partpath,
                    VWalkVolFunc volfunc, VWalkErrFunc errfunc, void *rock)
 {
-    DIR *dirp = NULL;
-    struct dirent *dentry = NULL;
+    DIR *dirp;
+    struct dirent *dentry;
     int code = 0;
     struct VolumeDiskHeader diskHeader;
 
@@ -839,8 +839,8 @@ VWalkVolumeHeaders(struct DiskPartition64 *dp, const char *partpath,
        goto done;
     }
 
-    while ((dentry = readdir(dirp))) {
-       char *p = dentry->d_name;
+    while ((dentry = readdir(dirp)) != NULL) {
+       char *p;
        p = strrchr(dentry->d_name, '.');
        if (p != NULL && strcmp(p, VHDREXT) == 0) {
            char name[VMAXPATHLEN];