From ab9f75c155aa4f386d01f227aa35b08a94ad9919 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Tue, 4 Feb 2014 15:13:49 -0500 Subject: [PATCH] VBOX: If we fail to terminate vboxmanage on a TIMEOUT, log the reason why. --- samples/vboxwrapper/vbox.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/samples/vboxwrapper/vbox.cpp b/samples/vboxwrapper/vbox.cpp index b3557296a2..764626e603 100644 --- a/samples/vboxwrapper/vbox.cpp +++ b/samples/vboxwrapper/vbox.cpp @@ -2821,7 +2821,14 @@ int VBOX_VM::vbm_popen_raw(string& command, string& output, unsigned int timeout // Timeout? if (ulExitTimeout >= (timeout * 1000)) { - TerminateProcess(pi.hProcess, EXIT_FAILURE); + if (!TerminateProcess(pi.hProcess, EXIT_FAILURE)) { + fprintf( + stderr, + "%s TerminateProcess failed! (%d).\n", + vboxwrapper_msg_prefix(buf, sizeof(buf)), + GetLastError() + ); + } ulExitCode = 0; retval = ERR_TIMEOUT; Sleep(1000);