util: polish the reexec thingy

This commit is contained in:
Jean-Francois Dockes
2012-03-06 07:27:39 +01:00
parent de9a06f04c
commit b49da9d838
2 changed files with 20 additions and 2 deletions
+6
View File
@@ -642,6 +642,12 @@ void ReExec::reexec()
}
#endif
// Execute the atexit funcs
while (!m_atexitfuncs.empty()) {
(m_atexitfuncs.top())();
m_atexitfuncs.pop();
}
// Try to get back to the initial working directory
if (m_cfd < 0 || fchdir(m_cfd) < 0) {
LOGINFO(("ReExec::reexec: fchdir failed, trying chdir\n"));