Close all file descriptors before restarting.

Refs #4905
This commit is contained in:
Gunnar Beutner 2013-10-17 18:19:54 +02:00
parent 2164ff22b9
commit c4941bb3c5
1 changed files with 5 additions and 0 deletions

View File

@ -479,6 +479,11 @@ int Application::Run(void)
#ifndef _WIN32 #ifndef _WIN32
String exePath = GetExePath(m_ArgV[0]); String exePath = GetExePath(m_ArgV[0]);
int fdcount = getdtablesize();
for (int i = 3; i < fdcount; i++)
(void) close(i);
(void) execv(exePath.CStr(), m_ArgV); (void) execv(exePath.CStr(), m_ArgV);
#else /* _WIN32 */ #else /* _WIN32 */
STARTUPINFO si; STARTUPINFO si;