+ /* Original name length + . + pid length in hex + null terminator */
+ filename_or_prefix = g_strdup_printf ("%s", filename);
+ binary_protocol_open_file (FALSE);
+
+ if (binary_protocol_file == -1) {
+ /* Another process owns the file, try adding the pid suffix to the filename */
+ gint32 pid = mono_process_current_pid ();
+ g_free (filename_or_prefix);
+ filename_or_prefix = g_strdup_printf ("%s.%x", filename, pid);
+ binary_protocol_open_file (TRUE);
+ }
+
+ /* If we have a file size limit, we might need to open additional files */
+ if (file_size_limit == 0)
+ g_free (filename_or_prefix);