Changeset 98725 in vbox
- Timestamp:
- Feb 24, 2023 2:48:07 PM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 156025
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/GuestCtrlImplPrivate.h
r98709 r98725 1020 1020 const char *GetString(const char *pszKey) const; 1021 1021 size_t GetCount(void) const; 1022 int GetVrc( void) const;1022 int GetVrc(bool fSucceedIfNotFound = false) const; 1023 1023 int GetInt64Ex(const char *pszKey, int64_t *piVal) const; 1024 1024 int64_t GetInt64(const char *pszKey) const; -
trunk/src/VBox/Main/src-client/GuestCtrlPrivate.cpp
r98666 r98725 429 429 #endif 430 430 /* Object name. */ 431 mName = strmBlk.GetString("fname"); 431 mName = strmBlk.GetString("fname"); /* Note: RTPathRmCmd() only sets this on failure. */ 432 432 433 433 /* Return the stream block's vrc. */ 434 return strmBlk.GetVrc( );434 return strmBlk.GetVrc(true /* fSucceedIfNotFound */); 435 435 } 436 436 … … 597 597 * @return VBox status code. 598 598 * @retval VERR_NOT_FOUND if the return code string ("rc") was not found. 599 */ 600 int GuestToolboxStreamBlock::GetVrc(void) const 599 * @param fSucceedIfNotFound When set to @c true, this reports back VINF_SUCCESS when the key ("rc") is not found. 600 * This can happen with some (older) IPRT-provided tools such as RTPathRmCmd(), which only outputs 601 * rc on failure but not on success. Defaults to @c false. 602 */ 603 int GuestToolboxStreamBlock::GetVrc(bool fSucceedIfNotFound /* = false */) const 601 604 { 602 605 const char *pszValue = GetString("rc"); 603 606 if (pszValue) 604 607 return RTStrToInt16(pszValue); 608 if (fSucceedIfNotFound) 609 return VINF_SUCCESS; 605 610 /** @todo We probably should have a dedicated error for that, VERR_GSTCTL_GUEST_TOOLBOX_whatever. */ 606 611 return VERR_NOT_FOUND;
Note:
See TracChangeset
for help on using the changeset viewer.