summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2013-04-10 16:29:03 -0700
committerAndreas Schneider <asn@samba.org>2013-04-12 14:33:40 +0200
commit0fe894fb89f4867e266bb04670a58101311e0234 (patch)
tree3c418c7a4f4d312717496dbb7c6f311f34d1d7c1 /source3
parentea14c9443178da9ae6ccbe71e573156396f6f699 (diff)
downloadsamba-0fe894fb89f4867e266bb04670a58101311e0234.tar.gz
samba-0fe894fb89f4867e266bb04670a58101311e0234.tar.bz2
samba-0fe894fb89f4867e266bb04670a58101311e0234.zip
Remove the "Ugly hack" that was the second use of dirfd().
The destructor does all the resource deallocation needed. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/dir.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index 7bca6bfd3d..00c33d6ec2 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -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;
}
}