Some implementations of SMB_VFS_CREATE_FILE implementations actually
keep an fd open for directories just as files. In this case it is
necessary to call fd_close when closing directories. This is safe
because fd_close is a no-op when fd == -1, which is true for directory
opens originating from open.c (the default SMB_VFS_CREATE_FILE
implementation).
fsp, NT_STATUS_OK);
}
+ status = fd_close(fsp);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0, ("Could not close dir! fname=%s, fd=%d, err=%d=%s\n",
+ fsp->fsp_name, fsp->fh->fd, errno, strerror(errno)));
+ }
+
/*
* Do the code common to files and directories.
*/