Bump API snapshot submodule
[mono.git] / mono / metadata / filewatcher.c
index 90a54d5050ad6aaea8545a0f8e7379f32d63eced..159a2537bcbf05459238ba5491a5a46be6816946 100644 (file)
@@ -1,5 +1,6 @@
-/*
- * filewatcher.c: File System Watcher internal calls
+/**
+ * \file
+ * File System Watcher internal calls
  *
  * Authors:
  *     Gonzalo Paniagua Javier (gonzalo@ximian.com)
@@ -28,7 +29,7 @@
 #include <mono/metadata/marshal.h>
 #include <mono/utils/mono-dl.h>
 #include <mono/utils/mono-io-portability.h>
-#include <mono/io-layer/io-layer.h>
+#include <mono/metadata/w32error.h>
 
 #ifdef HOST_WIN32
 
@@ -110,12 +111,15 @@ ves_icall_System_IO_FAMW_InternalFAMNextEvent (gpointer conn,
                                               gint *code,
                                               gint *reqnum)
 {
+       MonoError error;
        FAMEvent ev;
 
        if (FAMNextEvent (conn, &ev) == 1) {
-               *filename = mono_string_new (mono_domain_get (), ev.filename);
+               *filename = mono_string_new_checked (mono_domain_get (), ev.filename, &error);
                *code = ev.code;
                *reqnum = ev.fr.reqnum;
+               if (mono_error_set_pending_exception (&error))
+                       return FALSE;
                return TRUE;
        }