[mini-posix] close file stream before exec'ing into GDB/LLDB
authorBernhard Urban <bernhard.urban@xamarin.com>
Wed, 18 Jan 2017 13:08:50 +0000 (05:08 -0800)
committerBernhard Urban <bernhard.urban@xamarin.com>
Wed, 18 Jan 2017 14:47:48 +0000 (15:47 +0100)
otherwise it isn't ensured that the content is written to the file.

mono/mini/mini-posix.c

index 01d3af8f9e863256e624acab3fab9198a9c42399..d3d48d45a974a972b833f4af2530424c11cad3a1 100644 (file)
@@ -925,6 +925,7 @@ mono_gdb_render_native_backtraces (pid_t crashed_pid)
        return;
 
 exec:
+       fclose (commands);
        execv (argv [0], (char**)argv);
 
        _exit (-1);