本文整理汇总了C++中RTMsgErrorExit函数的典型用法代码示例。如果您正苦于以下问题:C++ RTMsgErrorExit函数的具体用法?C++ RTMsgErrorExit怎么用?C++ RTMsgErrorExit使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RTMsgErrorExit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rtZipUnzipCmdListCallback
static RTEXITCODE rtZipUnzipCmdListCallback(PRTZIPUNZIPCMDOPS pOpts, RTVFSOBJ hVfsObj,
const char *pszName, RTEXITCODE rcExit, PRTFOFF pcBytes)
{
RT_NOREF_PV(pOpts);
/*
* Query all the information.
*/
RTFSOBJINFO UnixInfo;
int rc = RTVfsObjQueryInfo(hVfsObj, &UnixInfo, RTFSOBJATTRADD_UNIX);
if (RT_FAILURE(rc))
return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTVfsObjQueryInfo returned %Rrc on '%s'", rc, pszName);
RTTIME time;
if (!RTTimeExplode(&time, &UnixInfo.ModificationTime))
return RTMsgErrorExit(RTEXITCODE_FAILURE, "Cannot explode time on '%s'", pszName);
RTPrintf("%9RU64 %04d-%02d-%02d %02d:%02d %s\n",
UnixInfo.cbObject,
time.i32Year, time.u8Month, time.u8MonthDay,
time.u8Hour, time.u8Minute,
pszName);
*pcBytes = UnixInfo.cbObject;
return rcExit;
}
示例2: tstRTPipe4Child
static RTEXITCODE tstRTPipe4Child(const char *pszPipe)
{
int rc = RTR3InitExeNoArguments(0);
if (RT_FAILURE(rc))
return RTMsgInitFailure(rc);
int64_t iNative;
rc = RTStrToInt64Full(pszPipe, 10, &iNative);
if (RT_FAILURE(rc))
return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTStrToUInt64Full(%s) -> %Rrc\n", pszPipe, rc);
RTPIPE hPipe;
rc = RTPipeFromNative(&hPipe, (RTHCINTPTR)iNative, RTPIPE_N_WRITE);
if (RT_FAILURE(rc))
return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTPipeFromNative(,%s,WRITE) -> %Rrc\n", pszPipe, rc);
rc = RTPipeWriteBlocking(hPipe, g_szTest4Message, sizeof(g_szTest4Message) - 1, NULL);
if (RT_FAILURE(rc))
return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTPipeWriteBlocking() -> %Rrc\n", rc);
rc = RTPipeClose(hPipe);
if (RT_FAILURE(rc))
return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTPipeClose() -> %Rrc\n", rc);
return RTEXITCODE_SUCCESS;
}
示例3: rtZipUnzipCmdOpenInputArchive
/**
* Opens the input archive specified by the options.
*
* @returns RTEXITCODE_SUCCESS or RTEXITCODE_FAILURE + printed message.
* @param pOpts The options.
* @param phVfsFss Where to return the UNZIP filesystem stream handle.
*/
static RTEXITCODE rtZipUnzipCmdOpenInputArchive(PRTZIPUNZIPCMDOPS pOpts, PRTVFSFSSTREAM phVfsFss)
{
/*
* Open the input file.
*/
RTVFSIOSTREAM hVfsIos;
const char *pszError;
int rc = RTVfsChainOpenIoStream(pOpts->pszFile,
RTFILE_O_READ | RTFILE_O_DENY_WRITE | RTFILE_O_OPEN,
&hVfsIos,
&pszError);
if (RT_FAILURE(rc))
{
if (pszError && *pszError)
return RTMsgErrorExit(RTEXITCODE_FAILURE,
"RTVfsChainOpenIoStream failed with rc=%Rrc:\n"
" '%s'\n",
" %*s^\n",
rc, pOpts->pszFile, pszError - pOpts->pszFile, "");
return RTMsgErrorExit(RTEXITCODE_FAILURE,
"Failed with %Rrc opening the input archive '%s'", rc, pOpts->pszFile);
}
rc = RTZipPkzipFsStreamFromIoStream(hVfsIos, 0 /*fFlags*/, phVfsFss);
RTVfsIoStrmRelease(hVfsIos);
if (RT_FAILURE(rc))
return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to open pkzip filesystem stream: %Rrc", rc);
return RTEXITCODE_SUCCESS;
}
示例4: rtDbgSymCacheAddDir
/**
* Adds a directory.
*
* @returns IPRT status code (fully bitched).
* @param pszPath The directory path.
* @param pCfg The configuration.
*/
static int rtDbgSymCacheAddDir(const char *pszPath, PCRTDBGSYMCACHEADDCFG pCfg)
{
/*
* Set up the path buffer, stripping any filter.
*/
char szPath[RTPATH_MAX];
int rc = RTStrCopy(szPath, sizeof(szPath) - 2, pszPath);
if (RT_FAILURE(rc))
return RTMsgErrorExit(RTEXITCODE_FAILURE, "Path too long: '%s'", pszPath);
size_t cchPath = strlen(pszPath);
if (!cchPath)
return RTMsgErrorExit(RTEXITCODE_FAILURE, "Path empty: '%s'", pszPath);
if (pCfg->pszFilter)
szPath[cchPath - strlen(pCfg->pszFilter)] = '\0';
cchPath = RTPathStripTrailingSlash(szPath);
if (!RTPATH_IS_SEP(pszPath[cchPath - 1]))
{
szPath[cchPath++] = RTPATH_SLASH;
szPath[cchPath] = '\0';
}
/*
* Let the worker do the rest.
*/
RTDIRENTRYEX DirEntry;
return rtDbgSymCacheAddDirWorker(szPath, cchPath, &DirEntry, pCfg);
}
示例5: LoadModules
/**
* Loads the modules.
*
* @returns RTEXITCODE_SUCCESS on success.
*/
static RTEXITCODE LoadModules(void)
{
for (uint32_t i = 0; i < RT_ELEMENTS(g_aModules); i++)
{
if (g_aModules[i].fPreload)
{
char szPath[RTPATH_MAX];
int rc = RTPathAppPrivateArch(szPath, sizeof(szPath));
if (RT_SUCCESS(rc))
rc = RTPathAppend(szPath, sizeof(szPath), g_aModules[i].pszName);
if (RT_FAILURE(rc))
return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTPathAppPrivateArch or RTPathAppend returned %Rrc", rc);
void *pvImageBase;
RTERRINFOSTATIC ErrInfo;
RTErrInfoInitStatic(&ErrInfo);
rc = SUPR3LoadModule(szPath, g_aModules[i].pszName, &g_aModules[i].pvImageBase, &ErrInfo.Core);
if (RT_FAILURE(rc))
return RTMsgErrorExit(RTEXITCODE_FAILURE, "SUPR3LoadModule failed for %s (%s): %s (rc=%Rrc)",
g_aModules[i].pszName, szPath, ErrInfo.Core.pszMsg, rc);
if (g_cVerbose >= 1)
RTMsgInfo("Loaded '%s' ('%s') at %p\n", szPath, g_aModules[i].pszName, g_aModules[i].pvImageBase);
}
}
RTStrmFlush(g_pStdOut);
return RTEXITCODE_SUCCESS;
}
示例6: gzipOpenInput
/**
* Opens the input file.
*
* @returns Command exit, error messages written using RTMsg*.
*
* @param pszFile The input filename.
* @param pOpts The options, szOutput will be filled in by this
* function on success.
* @param phVfsIos Where to return the input stream handle.
*/
static RTEXITCODE gzipOpenInput(const char *pszFile, PRTGZIPCMDOPTS pOpts, PRTVFSIOSTREAM phVfsIos)
{
int rc;
pOpts->pszInput = pszFile;
if (!strcmp(pszFile, "-"))
{
if ( !pOpts->fForce
&& pOpts->fDecompress
&& gzipIsStdHandleATty(RTHANDLESTD_OUTPUT))
return RTMsgErrorExit(RTEXITCODE_SYNTAX,
"Yeah, right. I'm not reading any compressed data from the terminal without --force.\n");
rc = RTVfsIoStrmFromStdHandle(RTHANDLESTD_INPUT,
RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE,
true /*fLeaveOpen*/,
phVfsIos);
if (RT_FAILURE(rc))
return RTMsgErrorExit(RTEXITCODE_FAILURE, "Error opening standard input: %Rrc", rc);
}
else
{
uint32_t offError = 0;
RTERRINFOSTATIC ErrInfo;
rc = RTVfsChainOpenIoStream(pszFile, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_WRITE,
phVfsIos, &offError, RTErrInfoInitStatic(&ErrInfo));
if (RT_FAILURE(rc))
return RTVfsChainMsgErrorExitFailure("RTVfsChainOpenIoStream", pszFile, rc, offError, &ErrInfo.Core);
}
return RTEXITCODE_SUCCESS;
}
示例7: cmdDisplayAll
/**
* Handler for the 'display-all' command.
*/
static RTEXITCODE cmdDisplayAll(int argc, char **argv)
{
if (argc != 1)
return RTMsgErrorExit(RTEXITCODE_SYNTAX, "the display-all command takes no arguments\n");
if (!CertEnumSystemStoreLocation(0, NULL /*pvArg*/, displaySystemStoreLocation))
return RTMsgErrorExit(RTEXITCODE_SYNTAX, "CertEnumSystemStoreLocation failed: %s\n", errorToString(GetLastError()));
return RTEXITCODE_SUCCESS;
}
示例8: main
int main(int argc, char **argv)
{
RTR3InitExeNoArguments(0);
if (argc != 1)
return RTMsgErrorExit(RTEXITCODE_SYNTAX, "This utility takes no arguments\n");
NOREF(argv);
int rc = SUPR3Uninstall();
if (RT_SUCCESS(rc))
{
RTMsgInfo("uninstalled successfully");
return RTEXITCODE_SUCCESS;
}
return RTMsgErrorExit(RTEXITCODE_FAILURE, "uninstallation failed. rc=%Rrc", rc);
}
示例9: rtZipUnzipCmdExtractCallback
static RTEXITCODE rtZipUnzipCmdExtractCallback(PRTZIPUNZIPCMDOPS pOpts, RTVFSOBJ hVfsObj,
const char *pszName, RTEXITCODE rcExit, PRTFOFF pcBytes)
{
if (pOpts->fVerbose)
RTPrintf("%s\n", pszName);
/*
* Query all the information.
*/
RTFSOBJINFO UnixInfo;
int rc = RTVfsObjQueryInfo(hVfsObj, &UnixInfo, RTFSOBJATTRADD_UNIX);
if (RT_FAILURE(rc))
return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTVfsObjQueryInfo returned %Rrc on '%s'", rc, pszName);
*pcBytes = UnixInfo.cbObject;
char szDst[RTPATH_MAX];
rc = RTPathJoin(szDst, sizeof(szDst), pOpts->pszDirectory ? pOpts->pszDirectory : ".", pszName);
if (RT_FAILURE(rc))
return RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Failed to construct destination path for: %Rrc", pszName, rc);
/*
* Extract according to the type.
*/
switch (UnixInfo.Attr.fMode & RTFS_TYPE_MASK)
{
case RTFS_TYPE_FILE:
return rtZipUnzipCmdExtractFile(pOpts, hVfsObj, rcExit, szDst, &UnixInfo);
case RTFS_TYPE_DIRECTORY:
rc = RTDirCreateFullPath(szDst, UnixInfo.Attr.fMode & RTFS_UNIX_ALL_ACCESS_PERMS);
if (RT_FAILURE(rc))
return RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Error creating directory: %Rrc", szDst, rc);
break;
default:
return RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Unknown file type.", pszName);
}
if (!pOpts->fNoModTimeDirectories)
{
rc = RTPathSetTimesEx(szDst, NULL, &UnixInfo.ModificationTime, NULL, NULL, RTPATH_F_ON_LINK);
if (RT_FAILURE(rc) && rc != VERR_NOT_SUPPORTED && rc != VERR_NS_SYMLINK_SET_TIME)
rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Error changing modification time: %Rrc.", pszName, rc);
}
return rcExit;
}
示例10: rtDbgSymCacheAddFileOrDir
/**
* Adds a file or directory.
*
* @returns Program exit code.
* @param pszPath The user supplied path to the file or directory.
* @param pszCache The path to the cache.
* @param fRecursive Whether to process directories recursively.
* @param fOverwriteOnConflict Whether to overwrite existing cache entry on
* conflict, or just leave it.
*/
static RTEXITCODE rtDbgSymCacheAddFileOrDir(const char *pszPath, const char *pszCache, bool fRecursive,
bool fOverwriteOnConflict)
{
RT_NOREF1(fOverwriteOnConflict);
RTDBGSYMCACHEADDCFG Cfg;
Cfg.fRecursive = fRecursive;
Cfg.pszCache = pszCache;
Cfg.pszFilter = NULL;
int rc;
RTDBGSYMCACHEFILETYPE enmType = rtDbgSymCacheFigureType(pszPath);
switch (enmType)
{
default:
case RTDBGSYMCACHEFILETYPE_INVALID:
return RTMsgErrorExit(RTEXITCODE_FAILURE, "Invalid: '%s'", pszPath);
case RTDBGSYMCACHEFILETYPE_DIR_FILTER:
Cfg.pszFilter = RTPathFilename(pszPath);
/* fall thru */
case RTDBGSYMCACHEFILETYPE_DIR:
rc = rtDbgSymCacheAddDir(pszPath, &Cfg);
break;
case RTDBGSYMCACHEFILETYPE_DEBUG_FILE:
rc = rtDbgSymCacheAddDebugFile(pszPath, &Cfg);
break;
case RTDBGSYMCACHEFILETYPE_IMAGE_FILE:
rc = rtDbgSymCacheAddImageFile(pszPath, NULL /*pszExtraSuff*/, RTDBG_CACHE_UUID_MAP_DIR_IMAGES, &Cfg);
break;
case RTDBGSYMCACHEFILETYPE_DEBUG_BUNDLE:
case RTDBGSYMCACHEFILETYPE_IMAGE_BUNDLE:
{
size_t cchPath = strlen(pszPath);
size_t cchFilename = strlen(RTPathFilename(pszPath));
char szPathBuf[RTPATH_MAX];
if (cchPath < sizeof(szPathBuf))
{
memcpy(szPathBuf, pszPath, cchPath + 1);
if (enmType == RTDBGSYMCACHEFILETYPE_DEBUG_BUNDLE)
rc = rtDbgSymCacheAddDebugBundle(szPathBuf, cchPath - cchFilename, cchFilename, &Cfg);
else
{
RTDIRENTRYEX DirEntry;
rc = rtDbgSymCacheAddImageBundle(szPathBuf, cchPath - cchFilename, cchFilename, &DirEntry, &Cfg);
}
}
else
rc = RTMsgErrorRc(VERR_FILENAME_TOO_LONG, "Filename too long: '%s'", pszPath);
break;
}
case RTDBGSYMCACHEFILETYPE_IGNORE:
rc = RTMsgErrorRc(VERR_INVALID_PARAMETER, "Invalid file: '%s'", pszPath);
break;
}
return RT_SUCCESS(rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;
}
示例11: gzipSetupDecompressor
/**
* Attach a decompressor to the given source stream, replacing and releasing the
* input handle with the decompressor.
*
* @returns Exit code.
* @param phVfsSrc The input stream. Replaced on success.
*/
static RTEXITCODE gzipSetupDecompressor(PRTVFSIOSTREAM phVfsSrc)
{
/*
* Attach the decompressor to the input stream.
*/
uint32_t fFlags = 0;
fFlags |= RTZIPGZIPDECOMP_F_ALLOW_ZLIB_HDR;
RTVFSIOSTREAM hVfsGunzip;
int rc = RTZipGzipDecompressIoStream(*phVfsSrc, fFlags, &hVfsGunzip);
if (RT_FAILURE(rc))
return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTZipGzipDecompressIoStream failed: %Rrc", rc);
uint32_t cRefs = RTVfsIoStrmRelease(*phVfsSrc);
Assert(cRefs > 0); RT_NOREF_PV(cRefs);
*phVfsSrc = hVfsGunzip;
#if 0
/* This is a good place for testing stuff. */
rc = RTVfsCreateReadAheadForIoStream(*phVfsSrc, 0, 16, _4K+1, &hVfsGunzip);
AssertRC(rc);
if (RT_SUCCESS(rc))
{
uint32_t cRefs = RTVfsIoStrmRelease(*phVfsSrc);
Assert(cRefs > 0);
*phVfsSrc = hVfsGunzip;
}
#endif
return RTEXITCODE_SUCCESS;
}
示例12: gzipPush
/**
* Pushes data from the input to the output I/O streams.
*
* @returns RTEXITCODE_SUCCESS or RTEXITCODE_FAILURE.
* @param hVfsSrc The source I/O stream.
* @param hVfsDst The destination I/O stream.
*/
static RTEXITCODE gzipPush(RTVFSIOSTREAM hVfsSrc, RTVFSIOSTREAM hVfsDst)
{
for (;;)
{
uint8_t abBuf[_64K];
size_t cbRead;
int rc = RTVfsIoStrmRead(hVfsSrc, abBuf, sizeof(abBuf), true /*fBlocking*/, &cbRead);
if (RT_FAILURE(rc))
return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTVfsIoStrmRead failed: %Rrc", rc);
if (rc == VINF_EOF && cbRead == 0)
return RTEXITCODE_SUCCESS;
rc = RTVfsIoStrmWrite(hVfsDst, abBuf, cbRead, true /*fBlocking*/, NULL /*cbWritten*/);
if (RT_FAILURE(rc))
return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTVfsIoStrmWrite failed: %Rrc", rc);
}
}
示例13: gzipOpenOutput
/**
* Opens the output file.
*
* @returns Command exit, error messages written using RTMsg*.
*
* @param pszFile The input filename.
* @param pOpts The options, szOutput will be filled in by this
* function on success.
* @param phVfsIos Where to return the output stream handle.
*
* @remarks This is actually not quite the way we need to do things.
*
* First of all, we need a GZIP file system stream for a real GZIP
* implementation, since there may be more than one file in the gzipped
* file.
*
* Second, we need to open the output files as we encounter files in the input
* file system stream. The gzip format contains timestamp and usually a
* filename, the default is to use this name (see the --no-name
* option).
*/
static RTEXITCODE gzipOpenOutput(const char *pszFile, PRTGZIPCMDOPTS pOpts, PRTVFSIOSTREAM phVfsIos)
{
int rc;
if (!strcmp(pszFile, "-") || pOpts->fStdOut)
{
strcpy(pOpts->szOutput, "-");
if ( !pOpts->fForce
&& !pOpts->fDecompress
&& gzipIsStdHandleATty(RTHANDLESTD_OUTPUT))
return RTMsgErrorExit(RTEXITCODE_SYNTAX,
"Yeah, right. I'm not writing any compressed data to the terminal without --force.\n");
rc = RTVfsIoStrmFromStdHandle(RTHANDLESTD_OUTPUT,
RTFILE_O_WRITE | RTFILE_O_OPEN | RTFILE_O_DENY_NONE,
true /*fLeaveOpen*/,
phVfsIos);
if (RT_FAILURE(rc))
return RTMsgErrorExit(RTEXITCODE_FAILURE, "Error opening standard output: %Rrc", rc);
}
else
{
Assert(!RTVfsChainIsSpec(pszFile));
/* Construct an output filename. */
rc = RTStrCopy(pOpts->szOutput, sizeof(pOpts->szOutput), pszFile);
if (RT_FAILURE(rc))
return RTMsgErrorExit(RTEXITCODE_FAILURE, "Error constructing output filename: %Rrc", rc);
if (pOpts->fDecompress)
{
/** @todo take filename from archive? */
size_t cchSuff = strlen(pOpts->pszSuff); Assert(cchSuff > 0);
size_t cch = strlen(pOpts->szOutput);
if ( cch <= cchSuff
|| strcmp(&pOpts->szOutput[cch - cchSuff], pOpts->pszSuff))
return RTMsgErrorExit(RTEXITCODE_FAILURE, "Input file does not end with: '%s'", pOpts->pszSuff);
pOpts->szOutput[cch - cchSuff] = '\0';
if (!RTPathFilename(pOpts->szOutput))
return RTMsgErrorExit(RTEXITCODE_FAILURE, "Error constructing output filename: Input file name is all suffix.");
}
else
{
rc = RTStrCat(pOpts->szOutput, sizeof(pOpts->szOutput), pOpts->pszSuff);
if (RT_FAILURE(rc))
return RTMsgErrorExit(RTEXITCODE_FAILURE, "Error constructing output filename: %Rrc", rc);
}
/* Open the output file. */
uint32_t fOpen = RTFILE_O_WRITE | RTFILE_O_DENY_WRITE;
if (pOpts->fForce)
fOpen |= RTFILE_O_CREATE_REPLACE;
else
fOpen |= RTFILE_O_CREATE;
rc = RTVfsIoStrmOpenNormal(pOpts->szOutput, fOpen, phVfsIos);
if (RT_FAILURE(rc))
return RTMsgErrorExit(RTEXITCODE_FAILURE, "Error opening output file '%s': %Rrc", pOpts->szOutput, rc);
}
return RTEXITCODE_SUCCESS;
}
示例14: VBoxServiceArgString
/** @todo Get rid of this and VBoxServiceArgUInt32() as soon as we have RTOpt handling. */
int VBoxServiceArgString(int argc, char **argv, const char *psz, int *pi, char *pszBuf, size_t cbBuf)
{
AssertPtrReturn(pszBuf, VERR_INVALID_POINTER);
AssertPtrReturn(cbBuf, VERR_INVALID_PARAMETER);
if (*psz == ':' || *psz == '=')
psz++;
if (!*psz)
{
if (*pi + 1 >= argc)
return RTMsgErrorExit(RTEXITCODE_SYNTAX, "Missing string for the '%s' argument\n", argv[*pi]);
psz = argv[++*pi];
}
if (!RTStrPrintf(pszBuf, cbBuf, "%s", psz))
return RTMsgErrorExit(RTEXITCODE_FAILURE, "String for '%s' argument too big\n", argv[*pi]);
return 0;
}
示例15: rtZipUnzipCmdExtractFile
/**
* Extracts a file.
*/
static RTEXITCODE rtZipUnzipCmdExtractFile(PRTZIPUNZIPCMDOPS pOpts, RTVFSOBJ hVfsObj, RTEXITCODE rcExit,
const char *pszDst, PCRTFSOBJINFO pUnixInfo)
{
/*
* Open the destination file and create a stream object for it.
*/
uint32_t fOpen = RTFILE_O_READWRITE | RTFILE_O_DENY_WRITE | RTFILE_O_CREATE_REPLACE | RTFILE_O_ACCESS_ATTR_DEFAULT
| (pUnixInfo->Attr.fMode << RTFILE_O_CREATE_MODE_SHIFT);
RTFILE hFile;
int rc = RTFileOpen(&hFile, pszDst, fOpen);
if (RT_FAILURE(rc))
return RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Error creating file: %Rrc", pszDst, rc);
RTVFSIOSTREAM hVfsIosDst;
rc = RTVfsIoStrmFromRTFile(hFile, fOpen, true /*fLeaveOpen*/, &hVfsIosDst);
if (RT_SUCCESS(rc))
{
/*
* Pump the data thru.
*/
RTVFSIOSTREAM hVfsIosSrc = RTVfsObjToIoStream(hVfsObj);
rc = RTVfsUtilPumpIoStreams(hVfsIosSrc, hVfsIosDst, (uint32_t)RT_MIN(pUnixInfo->cbObject, _1M));
if (RT_SUCCESS(rc))
{
/*
* Correct the file mode and other attributes.
*/
if (!pOpts->fNoModTimeFiles)
{
rc = RTFileSetTimes(hFile, NULL, &pUnixInfo->ModificationTime, NULL, NULL);
if (RT_FAILURE(rc))
rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Error setting times: %Rrc", pszDst, rc);
}
}
else
rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Error writing out file: %Rrc", pszDst, rc);
RTVfsIoStrmRelease(hVfsIosSrc);
RTVfsIoStrmRelease(hVfsIosDst);
}
else
rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Error creating I/O stream for file: %Rrc", pszDst, rc);
return rcExit;
}