s4-heimdal: a better way of handling dirfd()
authorAndrew Tridgell <tridge@samba.org>
Mon, 29 Mar 2010 11:47:34 +0000 (22:47 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 30 Mar 2010 01:31:03 +0000 (12:31 +1100)
This prevents us getting thousands of warnings about dirfd() on
solaris

source4/heimdal_build/config.h
source4/heimdal_build/roken.h

index be544cb83bb753da496f379b61b0dbf61e2ea90c..35981b85d2ffe7dffc845504130ded2dc7b78d98 100644 (file)
@@ -9,10 +9,6 @@
 #include "include/config.h"
 #include "../replace/replace.h"
 
-#if !defined(HAVE_DIRFD) && !defined(HAVE_DIRFD_DECL) && !defined(dirfd)
-#define dirfd(d) (-1)
-#endif
-
 #define RCSID(msg) struct __rcsid { int __rcsdi; }
 #define KRB5
 
index 172dc76a29af70c68c23c3dfa40d62242acc97ca..d8c49fb688e04b994ea440bf53df0b7eb8cf7d31 100644 (file)
 #define STRERROR_R_PROTO_COMPATIBLE
 #endif
 
+#ifndef HAVE_DIRFD
+#ifdef HAVE_DIR_DD_FD
+#define dirfd(x) ((x)->dd_fd)
+#else
+#define dirfd(d) (-1)
+#endif
+#define HAVE_DIRFD 1
+#endif
+
 
 /* we lie about having pidfile() so that NetBSD5 can compile. Nothing
    in the parts of heimdal we use actually uses pidfile(), and we