Typo
[mono.git] / mono / metadata / filewatcher.c
index fb8ba9ed16268889fb6c0c78ff0d99a9ca2f6cd0..b16ccc8a8ca203725fe25cb891af3f79a6106a2a 100644 (file)
@@ -4,7 +4,7 @@
  * Authors:
  *     Gonzalo Paniagua Javier (gonzalo@ximian.com)
  *
- * (C) 2004,2005,2006 Novell, Inc. (http://www.novell.com)
+ * Copyright 2004-2009 Novell, Inc (http://www.novell.com)
  */
 
 #ifdef HAVE_CONFIG_H
@@ -15,7 +15,8 @@
 #include <mono/metadata/exception.h>
 #include <mono/metadata/filewatcher.h>
 #include <mono/metadata/marshal.h>
-#if (defined (PLATFORM_WIN32) && WINVER >= 0x0400)
+#include <mono/utils/mono-dl.h>
+#ifdef HOST_WIN32
 
 /*
  * TODO:
@@ -46,10 +47,11 @@ ves_icall_System_IO_FSW_SupportsFSW (void)
 #if HAVE_KQUEUE
        return 3;
 #else
-       GModule *fam_module;
-       gchar *filename;
+       MonoDl *fam_module;
        int lib_used = 4; /* gamin */
        int inotify_instance;
+       void *iter;
+       char *err;
 
        MONO_ARCH_SAVE_REGS;
 
@@ -59,20 +61,19 @@ ves_icall_System_IO_FSW_SupportsFSW (void)
                return 5; /* inotify */
        }
 
-       filename = g_module_build_path (NULL, "libgamin-1.so.0");
-       fam_module = g_module_open (filename, G_MODULE_BIND_LAZY);
-       g_free (filename);
+       iter = NULL;
+       fam_module = mono_dl_open ("libgamin-1.so", MONO_DL_LAZY, NULL);
        if (fam_module == NULL) {
                lib_used = 2; /* FAM */
-               filename = g_module_build_path (NULL, "libfam.so.0");
-               fam_module = g_module_open (filename, G_MODULE_BIND_LAZY);
-               g_free (filename);
+               iter = NULL;
+               fam_module = mono_dl_open ("libfam.so", MONO_DL_LAZY, NULL);
        }
 
        if (fam_module == NULL)
                return 0;
 
-       g_module_symbol (fam_module, "FAMNextEvent", (gpointer *) &FAMNextEvent);
+       err = mono_dl_symbol (fam_module, "FAMNextEvent", (gpointer *) &FAMNextEvent);
+       g_free (err);
        if (FAMNextEvent == NULL)
                return 0;
 
@@ -154,7 +155,7 @@ int ves_icall_System_IO_InotifyWatcher_AddWatch (int fd, MonoString *directory,
        return -1;
 }
 
-int ves_icall_System_IO_InotifyWatcher_RemoveWatch (int fd, int watch_descriptor)
+int ves_icall_System_IO_InotifyWatcher_RemoveWatch (int fd, gint32 watch_descriptor)
 {
        return -1;
 }