Changeset 94958 in vbox
- Timestamp:
- May 9, 2022 2:09:57 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestDirectoryImpl.cpp
r93115 r94958 108 108 /* As we need to know if the directory we were about to open exists and and is accessible, 109 109 * do the first read here in order to return a meaningful status here. */ 110 int rcGuest = VERR_IPE_UNINITIALIZED_STATUS;111 vrc = i_readInternal(mData.mObjData, & rcGuest);110 int vrcGuest = VERR_IPE_UNINITIALIZED_STATUS; 111 vrc = i_readInternal(mData.mObjData, &vrcGuest); 112 112 if (RT_FAILURE(vrc)) 113 113 { … … 122 122 123 123 if (vrc == VERR_GSTCTL_GUEST_ERROR) 124 vrc = rcGuest;124 vrc = vrcGuest; 125 125 } 126 126 } … … 298 298 AssertPtrReturn(prcGuest, VERR_INVALID_POINTER); 299 299 300 int rc = mData.mProcessTool.terminate(30 * 1000 /* 30s timeout */, prcGuest);301 if (RT_FAILURE( rc))302 return rc;300 int vrc = mData.mProcessTool.terminate(30 * 1000 /* 30s timeout */, prcGuest); 301 if (RT_FAILURE(vrc)) 302 return vrc; 303 303 304 304 AssertPtr(mSession); 305 int rc2 = mSession->i_directoryUnregister(this);306 if (RT_SUCCESS( rc))307 rc =rc2;308 309 LogFlowThisFunc(("Returning rc=%Rrc\n",rc));310 return rc;305 int vrc2 = mSession->i_directoryUnregister(this); 306 if (RT_SUCCESS(vrc)) 307 vrc = vrc2; 308 309 LogFlowThisFunc(("Returning vrc=%Rrc\n", vrc)); 310 return vrc; 311 311 } 312 312 … … 323 323 324 324 GuestProcessStreamBlock curBlock; 325 int rc = mData.mProcessTool.waitEx(GUESTPROCESSTOOL_WAIT_FLAG_STDOUT_BLOCK, &curBlock, prcGuest);326 if (RT_SUCCESS( rc))325 int vrc = mData.mProcessTool.waitEx(GUESTPROCESSTOOL_WAIT_FLAG_STDOUT_BLOCK, &curBlock, prcGuest); 326 if (RT_SUCCESS(vrc)) 327 327 { 328 328 /* … … 331 331 */ 332 332 if (!mData.mProcessTool.isRunning()) 333 rc = mData.mProcessTool.getTerminationStatus(); /* Tool process is not running (anymore). Check termination status. */334 335 if (RT_SUCCESS( rc))333 vrc = mData.mProcessTool.getTerminationStatus(); /* Tool process is not running (anymore). Check termination status. */ 334 335 if (RT_SUCCESS(vrc)) 336 336 { 337 337 if (curBlock.GetCount()) /* Did we get content? */ … … 339 339 if (curBlock.GetString("name")) 340 340 { 341 rc = objData.FromLs(curBlock, true /* fLong */);341 vrc = objData.FromLs(curBlock, true /* fLong */); 342 342 } 343 343 else 344 rc = VERR_PATH_NOT_FOUND;344 vrc = VERR_PATH_NOT_FOUND; 345 345 } 346 346 else 347 347 { 348 348 /* Nothing to read anymore. Tell the caller. */ 349 rc = VERR_NO_MORE_FILES;350 } 351 } 352 } 353 354 LogFlowThisFunc(("Returning rc=%Rrc\n",rc));355 return rc;349 vrc = VERR_NO_MORE_FILES; 350 } 351 } 352 } 353 354 LogFlowThisFunc(("Returning vrc=%Rrc\n", vrc)); 355 return vrc; 356 356 } 357 357 … … 372 372 return VERR_COM_UNEXPECTED; 373 373 374 int rc;374 int vrc; 375 375 376 376 /* If we have a valid object data cache, read from it. */ 377 377 if (mData.mObjData.mName.isNotEmpty()) 378 378 { 379 rc = fsObjInfo->init(mData.mObjData);380 if (RT_SUCCESS( rc))379 vrc = fsObjInfo->init(mData.mObjData); 380 if (RT_SUCCESS(vrc)) 381 381 { 382 382 mData.mObjData.mName = ""; /* Mark the object data as being empty (beacon). */ … … 387 387 388 388 GuestFsObjData objData; 389 rc = i_readInternal(objData, prcGuest);390 if (RT_SUCCESS( rc))391 rc = fsObjInfo->init(objData);392 } 393 394 LogFlowThisFunc(("Returning rc=%Rrc\n",rc));395 return rc;389 vrc = i_readInternal(objData, prcGuest); 390 if (RT_SUCCESS(vrc)) 391 vrc = fsObjInfo->init(objData); 392 } 393 394 LogFlowThisFunc(("Returning vrc=%Rrc\n", vrc)); 395 return vrc; 396 396 } 397 397 … … 405 405 LogFlowThisFuncEnter(); 406 406 407 HRESULT hr = S_OK;408 409 int rcGuest = VERR_IPE_UNINITIALIZED_STATUS;410 int vrc = i_closeInternal(& rcGuest);407 HRESULT hrc = S_OK; 408 409 int vrcGuest = VERR_IPE_UNINITIALIZED_STATUS; 410 int vrc = i_closeInternal(&vrcGuest); 411 411 if (RT_FAILURE(vrc)) 412 412 { … … 415 415 case VERR_GSTCTL_GUEST_ERROR: 416 416 { 417 GuestErrorInfo ge(GuestErrorInfo::Type_Directory, rcGuest, mData.mOpenInfo.mPath.c_str());418 hr = setErrorBoth(VBOX_E_IPRT_ERROR,rcGuest, tr("Closing guest directory failed: %s"),419 GuestBase::getErrorAsString(ge).c_str());417 GuestErrorInfo ge(GuestErrorInfo::Type_Directory, vrcGuest, mData.mOpenInfo.mPath.c_str()); 418 hrc = setErrorBoth(VBOX_E_IPRT_ERROR, vrcGuest, tr("Closing guest directory failed: %s"), 419 GuestBase::getErrorAsString(ge).c_str()); 420 420 break; 421 421 } … … 426 426 427 427 default: 428 hr = setErrorBoth(VBOX_E_IPRT_ERROR, vrc,429 tr("Closing guest directory \"%s\" failed: %Rrc"), mData.mOpenInfo.mPath.c_str(), vrc);430 break; 431 } 432 } 433 434 return hr ;428 hrc = setErrorBoth(VBOX_E_IPRT_ERROR, vrc, 429 tr("Closing guest directory \"%s\" failed: %Rrc"), mData.mOpenInfo.mPath.c_str(), vrc); 430 break; 431 } 432 } 433 434 return hrc; 435 435 } 436 436 … … 442 442 LogFlowThisFuncEnter(); 443 443 444 HRESULT hr = S_OK;444 HRESULT hrc = S_OK; 445 445 446 446 ComObjPtr<GuestFsObjInfo> fsObjInfo; 447 int rcGuest = VERR_IPE_UNINITIALIZED_STATUS;448 int vrc = i_read(fsObjInfo, & rcGuest);447 int vrcGuest = VERR_IPE_UNINITIALIZED_STATUS; 448 int vrc = i_read(fsObjInfo, &vrcGuest); 449 449 if (RT_SUCCESS(vrc)) 450 450 { 451 451 /* Return info object to the caller. */ 452 hr = fsObjInfo.queryInterfaceTo(aObjInfo.asOutParam());452 hrc = fsObjInfo.queryInterfaceTo(aObjInfo.asOutParam()); 453 453 } 454 454 else … … 458 458 case VERR_GSTCTL_GUEST_ERROR: 459 459 { 460 GuestErrorInfo ge(GuestErrorInfo::Type_ToolLs, rcGuest, mData.mOpenInfo.mPath.c_str());461 hr = setErrorBoth(VBOX_E_IPRT_ERROR,rcGuest, tr("Reading guest directory failed: %s"),462 GuestBase::getErrorAsString(ge).c_str());460 GuestErrorInfo ge(GuestErrorInfo::Type_ToolLs, vrcGuest, mData.mOpenInfo.mPath.c_str()); 461 hrc = setErrorBoth(VBOX_E_IPRT_ERROR, vrcGuest, tr("Reading guest directory failed: %s"), 462 GuestBase::getErrorAsString(ge).c_str()); 463 463 break; 464 464 } 465 465 case VERR_GSTCTL_PROCESS_EXIT_CODE: 466 hr = setErrorBoth(VBOX_E_IPRT_ERROR, vrc, tr("Reading guest directory \"%s\" failed: %Rrc"),467 mData.mOpenInfo.mPath.c_str(), mData.mProcessTool.getRc());466 hrc = setErrorBoth(VBOX_E_IPRT_ERROR, vrc, tr("Reading guest directory \"%s\" failed: %Rrc"), 467 mData.mOpenInfo.mPath.c_str(), mData.mProcessTool.getRc()); 468 468 break; 469 469 470 470 case VERR_PATH_NOT_FOUND: 471 hr = setErrorBoth(VBOX_E_IPRT_ERROR, vrc, tr("Reading guest directory \"%s\" failed: Path not found"),472 mData.mOpenInfo.mPath.c_str());471 hrc = setErrorBoth(VBOX_E_IPRT_ERROR, vrc, tr("Reading guest directory \"%s\" failed: Path not found"), 472 mData.mOpenInfo.mPath.c_str()); 473 473 break; 474 474 475 475 case VERR_NO_MORE_FILES: 476 476 /* See SDK reference. */ 477 hr = setErrorBoth(VBOX_E_OBJECT_NOT_FOUND, vrc, tr("Reading guest directory \"%s\" failed: No more entries"),478 mData.mOpenInfo.mPath.c_str());477 hrc = setErrorBoth(VBOX_E_OBJECT_NOT_FOUND, vrc, tr("Reading guest directory \"%s\" failed: No more entries"), 478 mData.mOpenInfo.mPath.c_str()); 479 479 break; 480 480 481 481 default: 482 hr = setErrorBoth(VBOX_E_IPRT_ERROR, vrc, tr("Reading guest directory \"%s\" returned error: %Rrc\n"),483 mData.mOpenInfo.mPath.c_str(), vrc);484 break; 485 } 486 } 487 488 LogFlowThisFunc(("Returning hr =%Rhrc / vrc=%Rrc\n", hr, vrc));489 return hr ;490 } 491 482 hrc = setErrorBoth(VBOX_E_IPRT_ERROR, vrc, tr("Reading guest directory \"%s\" returned error: %Rrc\n"), 483 mData.mOpenInfo.mPath.c_str(), vrc); 484 break; 485 } 486 } 487 488 LogFlowThisFunc(("Returning hrc=%Rhrc / vrc=%Rrc\n", hrc, vrc)); 489 return hrc; 490 } 491
Note:
See TracChangeset
for help on using the changeset viewer.