vol: fix namei_ListAFSSubDirs on Windows
authorJeffrey Altman <jaltman@your-file-system.com>
Thu, 20 Jan 2011 06:56:33 +0000 (01:56 -0500)
committerDerrick Brashear <shadow@dementia.org>
Sat, 22 Jan 2011 20:43:24 +0000 (12:43 -0800)
The directory level represented by 'dirp2' does not exist on
Windows.  Do not attempt to close the DIR object that was
never opened.

Remove unnecessary function prototypes.

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

src/vol/namei_ops.c

index 3751c65..fd74e30 100644 (file)
@@ -2343,8 +2343,9 @@ namei_ListAFSSubDirs(IHandle_t * dirIH,
     IHandle_t myIH = *dirIH;
     namei_t name;
     char path1[512], path3[512];
-    DIR *dirp1, *dirp2, *dirp3;
+    DIR *dirp1, *dirp3;
 #ifndef AFS_NT40_ENV
+    DIR *dirp2;
     struct dirent *dp2;
     char path2[512];
 #endif
@@ -2358,11 +2359,6 @@ namei_ListAFSSubDirs(IHandle_t * dirIH,
     int wq_up = 0;
     struct rx_queue resultlist;
 #endif
-#ifdef DELETE_ZLC
-    int i;
-    static void AddToZLCDeleteList(char dir, char *name);
-    static void DeleteZLCFiles(char *path);
-#endif
 
     namei_HandleToVolDir(&name, &myIH);
     strlcpy(path1, name.n_path, sizeof(path1));
@@ -2493,7 +2489,9 @@ namei_ListAFSSubDirs(IHandle_t * dirIH,
 #ifdef AFS_SALSRV_ENV
                            if (error) {
                                closedir(dirp3);
+#ifndef AFS_NT40_ENV
                                closedir(dirp2);
+#endif
                                closedir(dirp1);
                                ret = -1;
                                goto error;
@@ -2507,7 +2505,9 @@ namei_ListAFSSubDirs(IHandle_t * dirIH,
                            switch (code) {
                            case -1:
                                closedir(dirp3);
+#ifndef AFS_NT40_ENV
                                closedir(dirp2);
+#endif
                                closedir(dirp1);
                                ret = -1;
                                goto error;