mirror of https://github.com/BOINC/boinc.git
- 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 svn path=/trunk/boinc/; revision=24184
This commit is contained in:
parent
e9c5bfe7a8
commit
98efec4538
|
@ -5936,3 +5936,11 @@ David 13 Sept 2011
|
||||||
|
|
||||||
samples/wrapper/
|
samples/wrapper/
|
||||||
wrapper.cpp
|
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
|
||||||
|
|
|
@ -106,6 +106,7 @@ int VBOX_VM::vbm_popen(string& arguments, string& output) {
|
||||||
command = "VBoxManage -q " + arguments;
|
command = "VBoxManage -q " + arguments;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
STARTUPINFO si;
|
STARTUPINFO si;
|
||||||
PROCESS_INFORMATION pi;
|
PROCESS_INFORMATION pi;
|
||||||
SECURITY_ATTRIBUTES sa;
|
SECURITY_ATTRIBUTES sa;
|
||||||
|
@ -205,10 +206,14 @@ CLEANUP:
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
FILE* fp;
|
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
|
// Execute command
|
||||||
fp = popen(command.c_str(), "r");
|
fp = popen(modified_command.c_str(), "r");
|
||||||
if (fp == NULL){
|
if (fp == NULL){
|
||||||
fprintf(
|
fprintf(
|
||||||
stderr,
|
stderr,
|
||||||
|
|
Loading…
Reference in New Issue