-/*
- * filewatcher.c: File System Watcher internal calls
+/**
+ * \file
+ * File System Watcher internal calls
*
* Authors:
* Gonzalo Paniagua Javier (gonzalo@ximian.com)
#include <mono/metadata/marshal.h>
#include <mono/utils/mono-dl.h>
#include <mono/utils/mono-io-portability.h>
+#include <mono/metadata/w32error.h>
+
#ifdef HOST_WIN32
/*
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;
}
int
ves_icall_System_IO_InotifyWatcher_AddWatch (int fd, MonoString *name, gint32 mask)
{
+ MonoError error;
char *str, *path;
int retval;
if (name == NULL)
return -1;
- str = mono_string_to_utf8 (name);
+ str = mono_string_to_utf8_checked (name, &error);
+ if (mono_error_set_pending_exception (&error))
+ return -1;
path = mono_portability_find_file (str, TRUE);
if (!path)
path = str;