Merge pull request #3749 from BrzVlad/fix-mips-fix
[mono.git] / mono / metadata / w32semaphore-unix.c
index 3a96f27d4a17056523e336481d7372b869394ec9..21e7921127aae4b0c69731225cecaeef9d58e4f8 100644 (file)
@@ -184,7 +184,7 @@ namedsem_create (gint32 initial, gint32 max, const gunichar2 *name)
        gchar *utf8_name;
 
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: creating %s handle, initial %d max %d name \"%s\"",
-               __func__, mono_w32handle_ops_typename (MONO_W32HANDLE_NAMEDSEM), initial, max, name);
+                   __func__, mono_w32handle_ops_typename (MONO_W32HANDLE_NAMEDSEM), initial, max, (const char*)name);
 
        /* w32 seems to guarantee that opening named objects can't race each other */
        mono_w32handle_namespace_lock ();
@@ -202,8 +202,7 @@ namedsem_create (gint32 initial, gint32 max, const gunichar2 *name)
                /* Not an error, but this is how the caller is informed that the semaphore wasn't freshly created */
                SetLastError (ERROR_ALREADY_EXISTS);
 
-               /* this is used as creating a new handle */
-               mono_w32handle_ref (handle);
+               /* mono_w32handle_namespace_search_handle already adds a ref to the handle */
        } else {
                /* A new named semaphore */
                MonoW32HandleNamedSemaphore namedsem_handle;