X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmetadata%2Ffilewatcher.c;h=90a54d5050ad6aaea8545a0f8e7379f32d63eced;hb=e7d19721c601da32575571c7621d4d28e564cf4b;hp=def11d9856d8be929b37c1fc92f0c48651ca4dd4;hpb=468225a247b8897b2a4fa1e6bd7ffa32aa8c243b;p=mono.git diff --git a/mono/metadata/filewatcher.c b/mono/metadata/filewatcher.c index def11d9856d..90a54d5050a 100644 --- a/mono/metadata/filewatcher.c +++ b/mono/metadata/filewatcher.c @@ -5,6 +5,7 @@ * Gonzalo Paniagua Javier (gonzalo@ximian.com) * * Copyright 2004-2009 Novell, Inc (http://www.novell.com) + * Licensed under the MIT license. See LICENSE file in the project root for full license information. */ #ifdef HAVE_CONFIG_H @@ -27,6 +28,8 @@ #include #include #include +#include + #ifdef HOST_WIN32 /* @@ -148,13 +151,16 @@ ves_icall_System_IO_InotifyWatcher_GetInotifyInstance () 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; @@ -230,9 +236,9 @@ ves_icall_System_IO_KqueueMonitor_kevent_notimeout (int *kq_ptr, gpointer change return -1; } - MONO_PREPARE_BLOCKING; + MONO_ENTER_GC_SAFE; res = kevent (*kq_ptr, changelist, nchanges, eventlist, nevents, NULL); - MONO_FINISH_BLOCKING; + MONO_EXIT_GC_SAFE; mono_thread_info_uninstall_interrupt (&interrupted);