From 141aca818ef9e5a6af309edc9512cc5cfee38e90 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 20 Jan 2011 01:56:33 -0500 Subject: [PATCH] vol: fix namei_ListAFSSubDirs on Windows 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 Tested-by: BuildBot --- src/vol/namei_ops.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/vol/namei_ops.c b/src/vol/namei_ops.c index 3751c65620..fd74e30c54 100644 --- a/src/vol/namei_ops.c +++ b/src/vol/namei_ops.c @@ -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;