svn commit: samba r14111 - in branches/SAMBA_3_0/source: . smbd

jpeach at samba.org jpeach at samba.org
Thu Mar 9 22:31:06 GMT 2006


Author: jpeach
Date: 2006-03-09 22:31:05 +0000 (Thu, 09 Mar 2006)
New Revision: 14111

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=14111

Log:
Work around additional typedefs in the gamin implementation
of the FAM API.

Modified:
   branches/SAMBA_3_0/source/configure.in
   branches/SAMBA_3_0/source/smbd/notify_fam.c


Changeset:
Modified: branches/SAMBA_3_0/source/configure.in
===================================================================
--- branches/SAMBA_3_0/source/configure.in	2006-03-09 22:25:50 UTC (rev 14110)
+++ branches/SAMBA_3_0/source/configure.in	2006-03-09 22:31:05 UTC (rev 14111)
@@ -2272,6 +2272,11 @@
 if test x"$samba_cv_HAVE_LIBFAM" = x"yes" ; then
     AC_DEFINE(HAVE_FAM_CHANGE_NOTIFY, 1,
 	    [Whether FAM is file notifications are available])
+    AC_TRY_COMPILE([#include <fam.h>],
+		[FAMCodes code = FAMChanged;],
+		AC_DEFINE(HAVE_FAM_H_FAMCODES_TYPEDEF, 1,
+		    [Whether fam.h contains a typedef for enum FAMCodes]),
+		[])
 fi
 
 AC_CACHE_CHECK([for kernel share modes],samba_cv_HAVE_KERNEL_SHARE_MODES,[

Modified: branches/SAMBA_3_0/source/smbd/notify_fam.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/notify_fam.c	2006-03-09 22:25:50 UTC (rev 14110)
+++ branches/SAMBA_3_0/source/smbd/notify_fam.c	2006-03-09 22:31:05 UTC (rev 14111)
@@ -24,6 +24,13 @@
 
 #include <fam.h>
 
+#if !defined(HAVE_FAM_H_FAMCODES_TYPEDEF)
+/* Gamin provides this typedef which means we can't use 'enum FAMCodes' as per
+ * every other FAM implementation. Phooey.
+ */
+typedef enum FAMCodes FAMCodes;
+#endif
+
 /* NOTE: There are multiple versions of FAM floating around the net, each with
  * slight differences from the original SGI FAM implementation. In this file,
  * we rely only on the SGI features and do not assume any extensions. For
@@ -40,7 +47,7 @@
 {
     FAMRequest	    req;
     int		    generation;
-    enum FAMCodes   code;
+    FAMCodes	    code;
     enum
     {
 	/* We are waiting for an event. */
@@ -91,9 +98,9 @@
  * because that might not work across all flavours of FAM.
  */
 static const char *
-fam_event_str(enum FAMCodes code)
+fam_event_str(FAMCodes code)
 {
-    static struct { enum FAMCodes code; const char * name; } evstr[] =
+    static const struct { FAMCodes code; const char * name; } evstr[] =
     {
 	{ FAMChanged,		"FAMChanged"},
 	{ FAMDeleted,		"FAMDeleted"},
@@ -188,7 +195,7 @@
 }
 
 static BOOL
-fam_handle_event(enum FAMCodes code, uint32 flags)
+fam_handle_event(const FAMCodes code, uint32 flags)
 {
 #define F_CHANGE_MASK (FILE_NOTIFY_CHANGE_FILE | \
 			FILE_NOTIFY_CHANGE_ATTRIBUTES | \



More information about the samba-cvs mailing list