mirror of
https://github.com/samba-team/samba.git
synced 2025-03-02 08:58:33 +03:00
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>
This commit is contained in:
parent
ea14c94431
commit
0fe894fb89
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user