diff --git a/checkin_notes b/checkin_notes index 4b24e7a616..471609d6cf 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5936,3 +5936,11 @@ David 13 Sept 2011 samples/wrapper/ wrapper.cpp + +Rom 13 Sept 2011 + - VBOX: Properly trap stderr output from vboxmanage by redirecting it to + stdout. Error messages should now be properly detected on Linux and + Mac. + + samples/vboxwrapper/ + vbox.cpp diff --git a/samples/vboxwrapper/vbox.cpp b/samples/vboxwrapper/vbox.cpp index 5b838ed49e..c8252d0708 100644 --- a/samples/vboxwrapper/vbox.cpp +++ b/samples/vboxwrapper/vbox.cpp @@ -106,6 +106,7 @@ int VBOX_VM::vbm_popen(string& arguments, string& output) { command = "VBoxManage -q " + arguments; #ifdef _WIN32 + STARTUPINFO si; PROCESS_INFORMATION pi; SECURITY_ATTRIBUTES sa; @@ -205,10 +206,14 @@ CLEANUP: return retval; #else + FILE* fp; + // redirect stderr to stdout for the child process so we can trap it with popen. + string modified_command = command + " 2>&1"; + // Execute command - fp = popen(command.c_str(), "r"); + fp = popen(modified_command.c_str(), "r"); if (fp == NULL){ fprintf( stderr,