Remove the "Ugly hack" that was the second use of dirfd().
authorJeremy Allison <jra@samba.org>
Wed, 10 Apr 2013 23:29:03 +0000 (16:29 -0700)
committerAndreas Schneider <asn@samba.org>
Fri, 12 Apr 2013 12:33:40 +0000 (14:33 +0200)
The destructor does all the resource deallocation needed.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/smbd/dir.c

index 7bca6bfd3d4908e05f464a92d7bc8f5f6461e354..00c33d6ec2723a5e2d98a1b07d0fd9b2ab2e227a 100644 (file)
@@ -679,20 +679,12 @@ done:
 void dptr_CloseDir(files_struct *fsp)
 {
        if (fsp->dptr) {
-/*
- * Ugly hack. We have defined fdopendir to return ENOSYS if dirfd also isn't
- * present. I hate Solaris. JRA.
- */
-#ifdef HAVE_DIRFD
-               if (fsp->fh->fd != -1 &&
-                               fsp->dptr->dir_hnd &&
-                               dirfd(fsp->dptr->dir_hnd->dir)) {
-                       /* The call below closes the underlying fd. */
-                       fsp->fh->fd = -1;
-               }
-#endif
+               /*
+                * The destructor for the struct smb_Dir
+                * (fsp->dptr->dir_hnd) now handles
+                * all resource deallocation.
+                */
                dptr_close_internal(fsp->dptr);
-               fsp->dptr = NULL;
        }
 }