Changeset 59637 in vbox for trunk/src/VBox/Frontends/VBoxBugReport
- Timestamp:
- Feb 11, 2016 1:10:28 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VBoxBugReport
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxBugReport/VBoxBugReport.cpp
r59628 r59637 556 556 hr = virtualBox.createLocalObject(CLSID_VirtualBox); 557 557 if (FAILED(hr)) 558 RTStrmPrintf(g_pStdErr, "WARNING: failed to create the VirtualBox object (hr=0x%x)\n", hr);558 RTStrmPrintf(g_pStdErr, "WARNING: Failed to create the VirtualBox object (hr=0x%x)\n", hr); 559 559 else 560 560 { 561 561 hr = session.createInprocObject(CLSID_Session); 562 562 if (FAILED(hr)) 563 RTStrmPrintf(g_pStdErr, "WARNING: failed to create a session object (hr=0x%x)\n", hr);563 RTStrmPrintf(g_pStdErr, "WARNING: Failed to create a session object (hr=0x%x)\n", hr); 564 564 } 565 565 … … 601 601 Time.u8Hour, Time.u8Minute, Time.u8Second, 602 602 fTextOutput ? "txt" : "tgz"); 603 RTCString strFallbackOutFile; 603 604 if (!pszOutputFile) 605 { 606 RTFILE tmp; 604 607 pszOutputFile = strOutFile.c_str(); 608 int rc = RTFileOpen(&tmp, pszOutputFile, RTFILE_O_WRITE | RTFILE_O_CREATE | RTFILE_O_DENY_WRITE); 609 if (rc == VERR_ACCESS_DENIED) 610 { 611 char szUserHome[RTPATH_MAX]; 612 handleRtError(RTPathUserHome(szUserHome, sizeof(szUserHome)), "Failed to obtain home directory"); 613 strFallbackOutFile.printf("%s/%s", szUserHome, strOutFile.c_str()); 614 pszOutputFile = strFallbackOutFile.c_str(); 615 } 616 else if (RT_SUCCESS(rc)) 617 { 618 RTFileClose(tmp); 619 RTFileDelete(pszOutputFile); 620 } 621 } 605 622 BugReport *pReport; 606 623 if (fTextOutput) … … 610 627 createBugReport(pReport, homeDir, list); 611 628 pReport->complete(); 629 RTPrintf("Report was written to '%s'\n", pszOutputFile); 612 630 delete pReport; 613 631 } -
trunk/src/VBox/Frontends/VBoxBugReport/VBoxBugReport.h
r59570 r59637 52 52 RTCString msgArgs(pszMsgFmt, va); 53 53 va_end(va); 54 RTCStringFmt msg("%s (rc=%d)\n", msgArgs.c_str(), rc);54 RTCStringFmt msg("%s. %s (%d)\n", msgArgs.c_str(), RTErrGetFull(rc), rc); 55 55 throw RTCError(msg.c_str()); 56 56 }
Note:
See TracChangeset
for help on using the changeset viewer.