Changeset 66602 in vbox for trunk/src/VBox/Runtime/common/zip
- Timestamp:
- Apr 18, 2017 3:27:30 PM (8 years ago)
- Location:
- trunk/src/VBox/Runtime/common/zip
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/zip/gzipvfs.cpp
r66601 r66602 835 835 */ 836 836 static DECLCALLBACK(int) rtVfsChainGunzip_Validate(PCRTVFSCHAINELEMENTREG pProviderReg, PRTVFSCHAINSPEC pSpec, 837 PRTVFSCHAINELEMSPEC pElement, uint32_t *poffError )838 { 839 RT_NOREF(pProviderReg, poffError );837 PRTVFSCHAINELEMSPEC pElement, uint32_t *poffError, PRTERRINFO pErrInfo) 838 { 839 RT_NOREF(pProviderReg, poffError, pErrInfo); 840 840 841 841 if (pElement->enmType != RTVFSOBJTYPE_IO_STREAM) … … 860 860 static DECLCALLBACK(int) rtVfsChainGunzip_Instantiate(PCRTVFSCHAINELEMENTREG pProviderReg, PCRTVFSCHAINSPEC pSpec, 861 861 PCRTVFSCHAINELEMSPEC pElement, RTVFSOBJ hPrevVfsObj, 862 PRTVFSOBJ phVfsObj, uint32_t *poffError )863 { 864 RT_NOREF(pProviderReg, pSpec, pElement, poffError );862 PRTVFSOBJ phVfsObj, uint32_t *poffError, PRTERRINFO pErrInfo) 863 { 864 RT_NOREF(pProviderReg, pSpec, pElement, poffError, pErrInfo); 865 865 AssertReturn(hPrevVfsObj != NIL_RTVFSOBJ, VERR_VFS_CHAIN_IPE); 866 866 … … 918 918 */ 919 919 static DECLCALLBACK(int) rtVfsChainGzip_Validate(PCRTVFSCHAINELEMENTREG pProviderReg, PRTVFSCHAINSPEC pSpec, 920 PRTVFSCHAINELEMSPEC pElement, uint32_t *poffError )920 PRTVFSCHAINELEMSPEC pElement, uint32_t *poffError, PRTERRINFO pErrInfo) 921 921 { 922 922 RT_NOREF(pProviderReg); … … 955 955 { 956 956 *poffError = pElement->paArgs[0].offSpec; 957 return VERR_VFS_CHAIN_INVALID_ARGUMENT;957 return RTErrInfoSet(pErrInfo, VERR_VFS_CHAIN_INVALID_ARGUMENT, "Expected compression level: 1-9, default, or fast"); 958 958 } 959 959 } … … 970 970 static DECLCALLBACK(int) rtVfsChainGzip_Instantiate(PCRTVFSCHAINELEMENTREG pProviderReg, PCRTVFSCHAINSPEC pSpec, 971 971 PCRTVFSCHAINELEMSPEC pElement, RTVFSOBJ hPrevVfsObj, 972 PRTVFSOBJ phVfsObj, uint32_t *poffError )973 { 974 RT_NOREF(pProviderReg, pSpec, pElement, poffError );972 PRTVFSOBJ phVfsObj, uint32_t *poffError, PRTERRINFO pErrInfo) 973 { 974 RT_NOREF(pProviderReg, pSpec, pElement, poffError, pErrInfo); 975 975 AssertReturn(hPrevVfsObj != NIL_RTVFSOBJ, VERR_VFS_CHAIN_IPE); 976 976 -
trunk/src/VBox/Runtime/common/zip/tarcmd.cpp
r65559 r66602 195 195 && strcmp(pOpts->pszFile, "-") != 0) 196 196 { 197 const char *pszError; 198 rc = RTVfsChainOpenIoStream(pOpts->pszFile, 199 RTFILE_O_READ | RTFILE_O_DENY_WRITE | RTFILE_O_OPEN, 200 &hVfsIos, 201 &pszError); 197 uint32_t offError = 0; 198 RTERRINFOSTATIC ErrInfo; 199 rc = RTVfsChainOpenIoStream(pOpts->pszFile, RTFILE_O_READ | RTFILE_O_DENY_WRITE | RTFILE_O_OPEN, 200 &hVfsIos, &offError, RTErrInfoInitStatic(&ErrInfo)); 202 201 if (RT_FAILURE(rc)) 203 { 204 if (pszError && *pszError) 205 return RTMsgErrorExit(RTEXITCODE_FAILURE, 206 "RTVfsChainOpenIoStream failed with rc=%Rrc:\n" 207 " '%s'\n" 208 " %*s^\n", 209 rc, pOpts->pszFile, pszError - pOpts->pszFile, ""); 210 return RTMsgErrorExit(RTEXITCODE_FAILURE, 211 "Failed with %Rrc opening the input archive '%s'", rc, pOpts->pszFile); 212 } 202 return RTVfsChainMsgErrorExitFailure("RTVfsChainOpenIoStream", pOpts->pszFile, rc, offError, &ErrInfo.Core); 213 203 } 214 204 else -
trunk/src/VBox/Runtime/common/zip/unzipcmd.cpp
r62564 r66602 256 256 * Open the input file. 257 257 */ 258 RTVFSIOSTREAM hVfsIos; 259 const char *pszError; 260 int rc = RTVfsChainOpenIoStream(pOpts->pszFile, 261 RTFILE_O_READ | RTFILE_O_DENY_WRITE | RTFILE_O_OPEN, 262 &hVfsIos, 263 &pszError); 264 if (RT_FAILURE(rc)) 265 { 266 if (pszError && *pszError) 267 return RTMsgErrorExit(RTEXITCODE_FAILURE, 268 "RTVfsChainOpenIoStream failed with rc=%Rrc:\n" 269 " '%s'\n" 270 " %*s^\n", 271 rc, pOpts->pszFile, pszError - pOpts->pszFile, ""); 272 return RTMsgErrorExit(RTEXITCODE_FAILURE, 273 "Failed with %Rrc opening the input archive '%s'", rc, pOpts->pszFile); 274 } 258 RTVFSIOSTREAM hVfsIos; 259 uint32_t offError = 0; 260 RTERRINFOSTATIC ErrInfo; 261 int rc = RTVfsChainOpenIoStream(pOpts->pszFile, RTFILE_O_READ | RTFILE_O_DENY_WRITE | RTFILE_O_OPEN, 262 &hVfsIos, &offError, RTErrInfoInitStatic(&ErrInfo)); 263 if (RT_FAILURE(rc)) 264 return RTVfsChainMsgErrorExitFailure("RTVfsChainOpenIoStream", pOpts->pszFile, rc, offError, &ErrInfo.Core); 275 265 276 266 rc = RTZipPkzipFsStreamFromIoStream(hVfsIos, 0 /*fFlags*/, phVfsFss);
Note:
See TracChangeset
for help on using the changeset viewer.