Changeset 42682 in vbox for trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
- Timestamp:
- Aug 8, 2012 1:41:32 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
r42673 r42682 1753 1753 strTemplate.c_str())); 1754 1754 procInfo.mCommand = Utf8Str(VBOXSERVICE_TOOL_MKTEMP); 1755 procInfo.mFlags = ProcessCreateFlag_Hidden 1756 | ProcessCreateFlag_WaitForStdOut; 1755 1757 /* Construct arguments. */ 1756 1758 procInfo.mArguments.push_back(Utf8Str("--machinereadable")); … … 1775 1777 30 * 1000 /* Timeout */, waitRes); 1776 1778 if ( RT_FAILURE(rc) 1777 || waitRes.mResult != ProcessWaitResult_StdOut) 1779 || waitRes.mResult == ProcessWaitResult_Terminate 1780 || waitRes.mResult == ProcessWaitResult_Error 1781 || waitRes.mResult == ProcessWaitResult_Timeout) 1778 1782 { 1779 1783 break; … … 1786 1790 break; 1787 1791 1788 rc = streamOut.AddData(byBuf, cbRead); 1789 if (RT_FAILURE(rc)) 1790 break; 1792 if (cbRead) 1793 { 1794 rc = streamOut.AddData(byBuf, cbRead); 1795 if (RT_FAILURE(rc)) 1796 break; 1797 } 1791 1798 } 1792 1799 … … 1794 1801 rc, cbRead, streamOut.GetSize())); 1795 1802 } 1796 1803 else 1804 return setError(E_FAIL, tr("Error while starting temporary directory creation tool on guest: %Rrc"), rc); 1797 1805 if (RT_FAILURE(rc)) 1798 return setError(E_FAIL, tr("Error while creating temporary directory: %Rrc"), rc);1806 return setError(E_FAIL, tr("Error while running temporary directory creation tool: %Rrc"), rc); 1799 1807 if (!streamOut.GetSize()) 1800 1808 return setError(E_FAIL, tr("No return code after creating temporary directory")); … … 1807 1815 if (RT_FAILURE(streamBlock.GetInt64Ex("rc", &i64rc))) 1808 1816 return setError(E_FAIL, tr("No return code after creating temporary directory")); 1809 // *aReturnCode = (LONG)i64rc; 1817 if (RT_FAILURE((int)i64rc)) 1818 return setError(VBOX_E_IPRT_ERROR, tr("File deletion failed: %Rrc"), rc); 1810 1819 } 1811 1820 else … … 2152 2161 strPath.c_str())); 2153 2162 procInfo.mCommand = Utf8Str(VBOXSERVICE_TOOL_RM); 2163 procInfo.mFlags = ProcessCreateFlag_Hidden 2164 | ProcessCreateFlag_WaitForStdOut; 2154 2165 /* Construct arguments. */ 2155 2166 procInfo.mArguments.push_back(Utf8Str("--machinereadable")); … … 2164 2175 rc = processCreateExInteral(procInfo, pProcess); 2165 2176 if (RT_SUCCESS(rc)) 2177 rc = pProcess->startProcess(); 2178 if (RT_SUCCESS(rc)) 2166 2179 { 2167 2180 GuestProcessWaitResult waitRes; … … 2174 2187 30 * 1000 /* Timeout */, waitRes); 2175 2188 if ( RT_FAILURE(rc) 2176 || waitRes.mResult != ProcessWaitResult_StdOut) 2189 || waitRes.mResult == ProcessWaitResult_Terminate 2190 || waitRes.mResult == ProcessWaitResult_Error 2191 || waitRes.mResult == ProcessWaitResult_Timeout) 2177 2192 { 2178 2193 break; … … 2185 2200 break; 2186 2201 2187 rc = streamOut.AddData(byBuf, cbRead); 2188 if (RT_FAILURE(rc)) 2189 break; 2202 if (cbRead) 2203 { 2204 rc = streamOut.AddData(byBuf, cbRead); 2205 if (RT_FAILURE(rc)) 2206 break; 2207 } 2190 2208 } 2191 2209 … … 2193 2211 rc, cbRead, streamOut.GetSize())); 2194 2212 } 2195 2213 else 2214 return setError(E_FAIL, tr("Error while starting delete tool on guest: %Rrc"), rc); 2196 2215 if (RT_FAILURE(rc)) 2197 return setError(E_FAIL, tr("Error while deleting file: %Rrc"), rc);2216 return setError(E_FAIL, tr("Error while running delete tool on guest: %Rrc"), rc); 2198 2217 if (!streamOut.GetSize()) 2199 2218 return setError(E_FAIL, tr("No return code after deleting file")); … … 2206 2225 if (RT_FAILURE(streamBlock.GetInt64Ex("rc", &i64rc))) 2207 2226 return setError(E_FAIL, tr("No return code after deleting file")); 2227 if (RT_FAILURE((int)i64rc)) 2228 return setError(VBOX_E_IPRT_ERROR, tr("File deletion failed: %Rrc"), rc); 2208 2229 } 2209 2230 else
Note:
See TracChangeset
for help on using the changeset viewer.