summaryrefslogtreecommitdiff
path: root/source3/smbd/dir.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2011-02-25 17:25:36 -0800
committerJeremy Allison <jra@samba.org>2011-02-26 04:19:55 +0100
commitc8a242d9fcb16df41a36b67ce2a8d43a3853b103 (patch)
tree08eef2215c559b4ad876e57a6649056020266e85 /source3/smbd/dir.c
parentebb2fb7efb1beea63720d3753685bb2eab5f19ee (diff)
downloadsamba-c8a242d9fcb16df41a36b67ce2a8d43a3853b103.tar.gz
samba-c8a242d9fcb16df41a36b67ce2a8d43a3853b103.tar.bz2
samba-c8a242d9fcb16df41a36b67ce2a8d43a3853b103.zip
dirfd doesn't exist in some platforms.
Hack that should get the buildfarm back to green. Ensure dirfd() needs to be defined before we properly return fdopendir. This will do until we get a proper dirfd() defined in libreplace. From http://www.gnu.org/software/hello/manual/gnulib/dirfd.html This function is missing on some platforms: AIX 7.1, HP-UX 11, OSF/1 5.1, Solaris 10, mingw. Jeremy. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sat Feb 26 04:19:55 CET 2011 on sn-devel-104
Diffstat (limited to 'source3/smbd/dir.c')
-rw-r--r--source3/smbd/dir.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index 5c502f7706..b9791e9dab 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -570,10 +570,16 @@ NTSTATUS dptr_create(connection_struct *conn, files_struct *fsp,
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 == dirfd(fsp->dptr->dir_hnd->dir)) {
/* The call below closes the underlying fd. */
fsp->fh->fd = -1;
}
+#endif
dptr_close_internal(fsp->dptr);
fsp->dptr = NULL;
}