VirtualBox

Changeset 72035 in vbox for trunk/src/VBox/Runtime/common


Ignore:
Timestamp:
Apr 26, 2018 11:33:32 AM (7 years ago)
Author:
vboxsync
Message:

RTTar: Implemented extracting hardlinked files by copying. This is very useful for extracting VBoxAll archives on windows.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/zip/tarcmd.cpp

    r69111 r72035  
    313313                                      &hVfsIos);
    314314        if (RT_FAILURE(rc))
    315             return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to prepare standard output for writing: %Rrc", rc);
     315            return RTMsgErrorExitFailure("Failed to prepare standard output for writing: %Rrc", rc);
    316316    }
    317317
     
    402402        }
    403403        else
    404             rc = RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to open tar filesystem stream: %Rrc", rc);
     404            rc = RTMsgErrorExitFailure("Failed to open tar filesystem stream: %Rrc", rc);
    405405    }
    406406    else
     
    408408    RTVfsIoStrmRelease(hVfsIos);
    409409    if (RT_FAILURE(rc))
    410         return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to open tar filesystem stream: %Rrc", rc);
     410        return RTMsgErrorExitFailure("Failed to open tar filesystem stream: %Rrc", rc);
    411411
    412412    return RTEXITCODE_SUCCESS;
     
    592592                                      &hVfsIos);
    593593        if (RT_FAILURE(rc))
    594             return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to prepare standard in for reading: %Rrc", rc);
     594            return RTMsgErrorExitFailure("Failed to prepare standard in for reading: %Rrc", rc);
    595595    }
    596596
     
    653653    RTVfsIoStrmRelease(hVfsIos);
    654654    if (RT_FAILURE(rc))
    655         return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to open tar filesystem stream: %Rrc", rc);
     655        return RTMsgErrorExitFailure("Failed to open tar filesystem stream: %Rrc", rc);
    656656
    657657    return RTEXITCODE_SUCCESS;
     
    677677        pbmFound = (uint32_t *)RTMemAllocZ(((pOpts->cFiles + 31) / 32) * sizeof(uint32_t));
    678678        if (!pbmFound)
    679             return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to allocate the found-file-bitmap");
     679            return RTMsgErrorExitFailure("Failed to allocate the found-file-bitmap");
    680680    }
    681681
     
    702702            {
    703703                if (rc != VERR_EOF)
    704                     rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "RTVfsFsStrmNext returned %Rrc", rc);
     704                    rcExit = RTMsgErrorExitFailure("RTVfsFsStrmNext returned %Rrc", rc);
    705705                break;
    706706            }
     
    774774}
    775775
     776
    776777#if !defined(RT_OS_WINDOWS) && !defined(RT_OS_OS2)
    777778
     
    798799        {
    799800            *pUid = NIL_RTUID;
    800             return RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: User resolving is not implemented.", pszName);
     801            return RTMsgErrorExitFailure("%s: User resolving is not implemented.", pszName);
    801802        }
    802803    }
     
    829830        {
    830831            *pGid = NIL_RTGID;
    831             return RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Group resolving is not implemented.", pszName);
     832            return RTMsgErrorExitFailure("%s: Group resolving is not implemented.", pszName);
    832833        }
    833834    }
     
    841842
    842843/**
     844 * Corrects the file mode and other attributes.
     845 *
     846 * Common worker for rtZipTarCmdExtractFile and rtZipTarCmdExtractHardlink.
     847 *
     848 * @returns rcExit or RTEXITCODE_FAILURE.
     849 * @param   pOpts               The tar options.
     850 * @param   rcExit              The current exit code.
     851 * @param   hFile               The handle to the destination file.
     852 * @param   pszDst              The destination path (for error reporting).
     853 * @param   pUnixInfo           The unix fs object info.
     854 * @param   pOwner              The owner info.
     855 * @param   pGroup              The group info.
     856 */
     857static RTEXITCODE rtZipTarCmdExtractSetAttribs(PRTZIPTARCMDOPS pOpts, RTEXITCODE rcExit, RTFILE hFile, const char *pszDst,
     858                                               PCRTFSOBJINFO pUnixInfo, PCRTFSOBJINFO pOwner, PCRTFSOBJINFO pGroup)
     859{
     860    int rc;
     861
     862    if (!pOpts->fNoModTime)
     863    {
     864        rc = RTFileSetTimes(hFile, NULL, &pUnixInfo->ModificationTime, NULL, NULL);
     865        if (RT_FAILURE(rc))
     866            rcExit = RTMsgErrorExitFailure("%s: Error setting times: %Rrc", pszDst, rc);
     867    }
     868
     869#if !defined(RT_OS_WINDOWS) && !defined(RT_OS_OS2)
     870    if (   pOpts->uidOwner != NIL_RTUID
     871        || pOpts->gidGroup != NIL_RTGID
     872        || pOpts->fPreserveOwner
     873        || pOpts->fPreserveGroup)
     874    {
     875        RTUID uidFile;
     876        rcExit = rtZipTarQueryExtractOwner(pOpts, pOwner, pszDst, rcExit, &uidFile);
     877
     878        RTGID gidFile;
     879        rcExit = rtZipTarQueryExtractGroup(pOpts, pGroup, pszDst, rcExit, &gidFile);
     880        if (uidFile != NIL_RTUID || gidFile != NIL_RTGID)
     881        {
     882            rc = RTFileSetOwner(hFile, uidFile, gidFile);
     883            if (RT_FAILURE(rc))
     884                rcExit = RTMsgErrorExitFailure("%s: Error owner/group: %Rrc", pszDst, rc);
     885        }
     886    }
     887#else
     888    RT_NOREF_PV(pOwner); RT_NOREF_PV(pGroup);
     889#endif
     890
     891    RTFMODE fMode = (pUnixInfo->Attr.fMode & pOpts->fFileModeAndMask) | pOpts->fFileModeOrMask;
     892    rc = RTFileSetMode(hFile, fMode | RTFS_TYPE_FILE);
     893    if (RT_FAILURE(rc))
     894        rcExit = RTMsgErrorExitFailure("%s: Error changing mode: %Rrc", pszDst, rc);
     895
     896    return rcExit;
     897}
     898
     899
     900/**
     901 * Extracts a hard linked file.
     902 *
     903 * @returns rcExit or RTEXITCODE_FAILURE.
     904 * @param   pOpts               The tar options.
     905 * @param   rcExit              The current exit code.
     906 * @param   pszDst              The destination path.
     907 * @param   pszTarget           The target relative path.
     908 * @param   pUnixInfo           The unix fs object info.
     909 * @param   pOwner              The owner info.
     910 * @param   pGroup              The group info.
     911 */
     912static RTEXITCODE rtZipTarCmdExtractHardlink(PRTZIPTARCMDOPS pOpts, RTEXITCODE rcExit, const char *pszDst,
     913                                             const char *pszTarget, PCRTFSOBJINFO pUnixInfo, PCRTFSOBJINFO pOwner,
     914                                             PCRTFSOBJINFO pGroup)
     915{
     916    /*
     917     * Construct full target path and check that it exists.
     918     */
     919    char szFullTarget[RTPATH_MAX];
     920    int rc = RTPathJoin(szFullTarget, sizeof(szFullTarget), pOpts->pszDirectory ? pOpts->pszDirectory : ".", pszTarget);
     921    if (RT_FAILURE(rc))
     922        return RTMsgErrorExitFailure("%s: Failed to construct full hardlink target path for %s: %Rrc",
     923                                     pszDst, pszTarget, rc);
     924
     925    if (!RTFileExists(szFullTarget))
     926        return RTMsgErrorExitFailure("%s: Hardlink target not found (or not a file): %s", pszDst, szFullTarget, rc);
     927
     928    /*
     929     * Try hardlink the file, falling back on copying.
     930     */
     931    /** @todo actual hardlinking */
     932    if (true)
     933    {
     934        RTMsgWarning("%s: Hardlinking not available, copying '%s' instead.", pszDst, szFullTarget);
     935
     936        RTFILE hSrcFile;
     937        rc = RTFileOpen(&hSrcFile, szFullTarget, RTFILE_O_READ | RTFILE_O_DENY_WRITE | RTFILE_O_OPEN);
     938        if (RT_SUCCESS(rc))
     939        {
     940            uint32_t fOpen = RTFILE_O_READWRITE | RTFILE_O_DENY_WRITE | RTFILE_O_CREATE_REPLACE | RTFILE_O_ACCESS_ATTR_DEFAULT
     941                           | ((RTFS_UNIX_IWUSR | RTFS_UNIX_IRUSR) << RTFILE_O_CREATE_MODE_SHIFT);
     942            RTFILE hDstFile;
     943            rc = RTFileOpen(&hDstFile, pszDst, fOpen);
     944            if (RT_SUCCESS(rc))
     945            {
     946                rc = RTFileCopyByHandles(hSrcFile, hDstFile);
     947                if (RT_SUCCESS(rc))
     948                {
     949                    rcExit = rtZipTarCmdExtractSetAttribs(pOpts, rcExit, hDstFile, pszDst, pUnixInfo, pOwner, pGroup);
     950                    rc = RTFileClose(hDstFile);
     951                    if (RT_FAILURE(rc))
     952                    {
     953                        rcExit = RTMsgErrorExitFailure("%s: Error closing hardlinked file copy: %Rrc", pszDst, szFullTarget, rc);
     954                        RTFileDelete(pszDst);
     955                    }
     956                }
     957                else
     958                {
     959                    rcExit = RTMsgErrorExitFailure("%s: Failed copying hardlinked file %s: %Rrc", pszDst, szFullTarget, rc);
     960                    rc = RTFileClose(hDstFile);
     961                    RTFileDelete(pszDst);
     962                }
     963            }
     964            else
     965                rcExit = RTMsgErrorExitFailure("%s: Error creating file: %Rrc", pszDst, rc);
     966            RTFileClose(hSrcFile);
     967        }
     968        else
     969            rcExit = RTMsgErrorExitFailure("%s: Error opening file '%s' for reading (hardlink target): %Rrc",
     970                                           pszDst, szFullTarget, rc);
     971    }
     972
     973    return rcExit;
     974}
     975
     976
     977
     978/**
    843979 * Extracts a file.
    844980 *
     
    850986 * @param   hVfsObj             The tar object to display
    851987 * @param   rcExit              The current exit code.
     988 * @param   pszDst              The destination path.
    852989 * @param   pUnixInfo           The unix fs object info.
    853990 * @param   pOwner              The owner info.
     
    8651002    int rc = RTFileOpen(&hFile, pszDst, fOpen);
    8661003    if (RT_FAILURE(rc))
    867         return RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Error creating file: %Rrc", pszDst, rc);
     1004        return RTMsgErrorExitFailure("%s: Error creating file: %Rrc", pszDst, rc);
    8681005
    8691006    RTVFSIOSTREAM hVfsIosDst;
     
    8891026
    8901027        /*
    891          * Pump the data thru.
     1028         * Pump the data thru and correct the file attributes.
    8921029         */
    8931030        rc = RTVfsUtilPumpIoStreams(hVfsIosSrc, hVfsIosDst, (uint32_t)RT_MIN(pUnixInfo->cbObject, _1M));
    8941031        if (RT_SUCCESS(rc))
    895         {
    896             /*
    897              * Correct the file mode and other attributes.
    898              */
    899             if (!pOpts->fNoModTime)
    900             {
    901                 rc = RTFileSetTimes(hFile, NULL, &pUnixInfo->ModificationTime, NULL, NULL);
    902                 if (RT_FAILURE(rc))
    903                     rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Error setting times: %Rrc", pszDst, rc);
    904             }
    905 
    906 #if !defined(RT_OS_WINDOWS) && !defined(RT_OS_OS2)
    907             if (   pOpts->uidOwner != NIL_RTUID
    908                 || pOpts->gidGroup != NIL_RTGID
    909                 || pOpts->fPreserveOwner
    910                 || pOpts->fPreserveGroup)
    911             {
    912                 RTUID uidFile;
    913                 rcExit = rtZipTarQueryExtractOwner(pOpts, pOwner, pszDst, rcExit, &uidFile);
    914 
    915                 RTGID gidFile;
    916                 rcExit = rtZipTarQueryExtractGroup(pOpts, pGroup, pszDst, rcExit, &gidFile);
    917                 if (uidFile != NIL_RTUID || gidFile != NIL_RTGID)
    918                 {
    919                     rc = RTFileSetOwner(hFile, uidFile, gidFile);
    920                     if (RT_FAILURE(rc))
    921                         rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Error owner/group: %Rrc", pszDst, rc);
    922                 }
    923             }
    924 #else
    925             RT_NOREF_PV(pOwner); RT_NOREF_PV(pGroup);
    926 #endif
    927 
    928             RTFMODE fMode = (pUnixInfo->Attr.fMode & pOpts->fFileModeAndMask) | pOpts->fFileModeOrMask;
    929             rc = RTFileSetMode(hFile, fMode | RTFS_TYPE_FILE);
    930             if (RT_FAILURE(rc))
    931                 rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Error changing mode: %Rrc", pszDst, rc);
    932         }
     1032            rcExit = rtZipTarCmdExtractSetAttribs(pOpts, rcExit, hFile, pszDst, pUnixInfo, pOwner, pGroup);
    9331033        else
    934             rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Error writing out file: %Rrc", pszDst, rc);
     1034            rcExit = RTMsgErrorExitFailure("%s: Error writing out file: %Rrc", pszDst, rc);
    9351035        RTVfsIoStrmRelease(hVfsIosSrc);
    9361036        RTVfsIoStrmRelease(hVfsIosDst);
    9371037    }
    9381038    else
    939         rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Error creating I/O stream for file: %Rrc", pszDst, rc);
     1039        rcExit = RTMsgErrorExitFailure("%s: Error creating I/O stream for file: %Rrc", pszDst, rc);
    9401040    RTFileClose(hFile);
    9411041    return rcExit;
     
    9571057    int rc = RTVfsObjQueryInfo(hVfsObj, &UnixInfo, RTFSOBJATTRADD_UNIX);
    9581058    if (RT_FAILURE(rc))
    959         return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTVfsObjQueryInfo returned %Rrc on '%s'", rc, pszName);
     1059        return RTMsgErrorExitFailure("RTVfsObjQueryInfo returned %Rrc on '%s'", rc, pszName);
    9601060
    9611061    RTFSOBJINFO Owner;
     
    9731073                              rc, pszName);
    9741074
     1075    bool fIsHardLink = false;
    9751076    char szTarget[RTPATH_MAX];
    9761077    szTarget[0] = '\0';
     
    9811082        RTVfsSymlinkRelease(hVfsSymlink);
    9821083        if (RT_FAILURE(rc))
    983             return RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: RTVfsSymlinkRead failed: %Rrc", pszName, rc);
     1084            return RTMsgErrorExitFailure("%s: RTVfsSymlinkRead failed: %Rrc", pszName, rc);
     1085        if (!szTarget[0])
     1086            return RTMsgErrorExitFailure("%s: Link target is empty.", pszName);
    9841087        if (!RTFS_IS_SYMLINK(UnixInfo.Attr.fMode))
    985             return RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Hardlinks are not supported.", pszName);
    986         if (!szTarget[0])
    987             return RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Link target is empty.", pszName);
     1088        {
     1089            fIsHardLink = true;
     1090            if (!RTFS_IS_FILE(UnixInfo.Attr.fMode))
     1091                return RTMsgErrorExitFailure("%s: Hardlinks are only supported for regular files (target=%s).",
     1092                                             pszName, szTarget);
     1093            if (rtZipTarHasEscapeSequence(pszName))
     1094                return RTMsgErrorExitFailure("%s: Hardlink target '%s' contains an escape sequence.",
     1095                                             pszName, szTarget);
     1096        }
    9881097    }
    9891098    else if (RTFS_IS_SYMLINK(UnixInfo.Attr.fMode))
    990         return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to get symlink object for '%s'", pszName);
     1099        return RTMsgErrorExitFailure("Failed to get symlink object for '%s'", pszName);
    9911100
    9921101    if (rtZipTarHasEscapeSequence(pszName))
    993         return RTMsgErrorExit(RTEXITCODE_FAILURE, "Name '%s' contains an escape sequence.", pszName);
     1102        return RTMsgErrorExitFailure("Name '%s' contains an escape sequence.", pszName);
    9941103
    9951104    /*
     
    9991108    rc = RTPathJoin(szDst, sizeof(szDst), pOpts->pszDirectory ? pOpts->pszDirectory : ".", pszName);
    10001109    if (RT_FAILURE(rc))
    1001         return RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Failed to construct destination path for: %Rrc", pszName, rc);
     1110        return RTMsgErrorExitFailure("%s: Failed to construct destination path for: %Rrc", pszName, rc);
    10021111
    10031112    /*
    10041113     * Extract according to the type.
    10051114     */
    1006     switch (UnixInfo.Attr.fMode & RTFS_TYPE_MASK)
    1007     {
    1008         case RTFS_TYPE_FILE:
    1009             return rtZipTarCmdExtractFile(pOpts, hVfsObj, rcExit, szDst, &UnixInfo, &Owner, &Group);
    1010 
    1011         case RTFS_TYPE_DIRECTORY:
    1012             rc = RTDirCreateFullPath(szDst, UnixInfo.Attr.fMode & RTFS_UNIX_ALL_ACCESS_PERMS);
    1013             if (RT_FAILURE(rc))
    1014                 return RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Error creating directory: %Rrc", szDst, rc);
    1015             break;
    1016 
    1017         case RTFS_TYPE_SYMLINK:
    1018             rc = RTSymlinkCreate(szDst, szTarget, RTSYMLINKTYPE_UNKNOWN, 0);
    1019             if (RT_FAILURE(rc))
    1020                 return RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Error creating symbolic link: %Rrc", szDst, rc);
    1021             break;
    1022 
    1023         case RTFS_TYPE_FIFO:
    1024             return RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: FIFOs are not supported.", pszName);
    1025         case RTFS_TYPE_DEV_CHAR:
    1026             return RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: FIFOs are not supported.", pszName);
    1027         case RTFS_TYPE_DEV_BLOCK:
    1028             return RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Block devices are not supported.", pszName);
    1029         case RTFS_TYPE_SOCKET:
    1030             return RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Sockets are not supported.", pszName);
    1031         case RTFS_TYPE_WHITEOUT:
    1032             return RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Whiteouts are not support.", pszName);
    1033         default:
    1034             return RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Unknown file type.", pszName);
    1035     }
     1115    if (!fIsHardLink)
     1116        switch (UnixInfo.Attr.fMode & RTFS_TYPE_MASK)
     1117        {
     1118            case RTFS_TYPE_FILE:
     1119                return rtZipTarCmdExtractFile(pOpts, hVfsObj, rcExit, szDst, &UnixInfo, &Owner, &Group);
     1120
     1121            case RTFS_TYPE_DIRECTORY:
     1122                rc = RTDirCreateFullPath(szDst, UnixInfo.Attr.fMode & RTFS_UNIX_ALL_ACCESS_PERMS);
     1123                if (RT_FAILURE(rc))
     1124                    return RTMsgErrorExitFailure("%s: Error creating directory: %Rrc", szDst, rc);
     1125                break;
     1126
     1127            case RTFS_TYPE_SYMLINK:
     1128                rc = RTSymlinkCreate(szDst, szTarget, RTSYMLINKTYPE_UNKNOWN, 0);
     1129                if (RT_FAILURE(rc))
     1130                    return RTMsgErrorExitFailure("%s: Error creating symbolic link: %Rrc", szDst, rc);
     1131                break;
     1132
     1133            case RTFS_TYPE_FIFO:
     1134                return RTMsgErrorExitFailure("%s: FIFOs are not supported.", pszName);
     1135            case RTFS_TYPE_DEV_CHAR:
     1136                return RTMsgErrorExitFailure("%s: FIFOs are not supported.", pszName);
     1137            case RTFS_TYPE_DEV_BLOCK:
     1138                return RTMsgErrorExitFailure("%s: Block devices are not supported.", pszName);
     1139            case RTFS_TYPE_SOCKET:
     1140                return RTMsgErrorExitFailure("%s: Sockets are not supported.", pszName);
     1141            case RTFS_TYPE_WHITEOUT:
     1142                return RTMsgErrorExitFailure("%s: Whiteouts are not support.", pszName);
     1143            default:
     1144                return RTMsgErrorExitFailure("%s: Unknown file type.", pszName);
     1145        }
     1146    else
     1147        return rtZipTarCmdExtractHardlink(pOpts, rcExit, szDst, szTarget, &UnixInfo, &Owner, &Group);
    10361148
    10371149    /*
     
    10441156        rc = RTPathSetTimesEx(szDst, NULL, &UnixInfo.ModificationTime, NULL, NULL, RTPATH_F_ON_LINK);
    10451157        if (RT_FAILURE(rc) && rc != VERR_NOT_SUPPORTED && rc != VERR_NS_SYMLINK_SET_TIME)
    1046             rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Error changing modification time: %Rrc.", pszName, rc);
     1158            rcExit = RTMsgErrorExitFailure("%s: Error changing modification time: %Rrc.", pszName, rc);
    10471159    }
    10481160
     
    10621174            rc = RTPathSetOwnerEx(szDst, uidFile, gidFile, RTPATH_F_ON_LINK);
    10631175            if (RT_FAILURE(rc))
    1064                 rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Error owner/group: %Rrc", szDst, rc);
     1176                rcExit = RTMsgErrorExitFailure("%s: Error owner/group: %Rrc", szDst, rc);
    10651177        }
    10661178    }
     
    10771189        rc = RTPathSetMode(szDst, fMode);
    10781190        if (RT_FAILURE(rc))
    1079             rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "%s: Error changing mode: %Rrc", szDst, rc);
     1191            rcExit = RTMsgErrorExitFailure("%s: Error changing mode: %Rrc", szDst, rc);
    10801192    }
    10811193#endif
     
    11061218    if (RT_FAILURE(rc))
    11071219    {
    1108         rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "RTVfsObjQueryInfo returned %Rrc on '%s'", rc, pszName);
     1220        rcExit = RTMsgErrorExitFailure("RTVfsObjQueryInfo returned %Rrc on '%s'", rc, pszName);
    11091221        RT_ZERO(UnixInfo);
    11101222    }
     
    11381250        rc = RTVfsSymlinkRead(hVfsSymlink, szTarget, sizeof(szTarget));
    11391251        if (RT_FAILURE(rc))
    1140             rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "RTVfsSymlinkRead returned %Rrc on '%s'", rc, pszName);
     1252            rcExit = RTMsgErrorExitFailure("RTVfsSymlinkRead returned %Rrc on '%s'", rc, pszName);
    11411253        RTVfsSymlinkRelease(hVfsSymlink);
    11421254        pszLinkType = RTFS_IS_SYMLINK(UnixInfo.Attr.fMode) ? "->" : "link to";
    11431255    }
    11441256    else if (RTFS_IS_SYMLINK(UnixInfo.Attr.fMode))
    1145         rcExit = RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to get symlink object for '%s'", pszName);
     1257        rcExit = RTMsgErrorExitFailure("Failed to get symlink object for '%s'", pszName);
    11461258
    11471259    /*
     
    14081520                          RTGETOPTINIT_FLAGS_OPTS_FIRST);
    14091521    if (RT_FAILURE(rc))
    1410         return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTGetOpt failed: %Rrc", rc);
     1522        return RTMsgErrorExitFailure("RTGetOpt failed: %Rrc", rc);
    14111523
    14121524    RTZIPTARCMDOPS Opts;
     
    16191731    if (   Opts.iOperation == 'x'
    16201732        && Opts.pszOwner)
    1621         return RTMsgErrorExit(RTEXITCODE_FAILURE, "The use of --owner with %s has not implemented yet", Opts.pszOperation);
     1733        return RTMsgErrorExitFailure("The use of --owner with %s has not implemented yet", Opts.pszOperation);
    16221734
    16231735    if (   Opts.iOperation == 'x'
    16241736        && Opts.pszGroup)
    1625         return RTMsgErrorExit(RTEXITCODE_FAILURE, "The use of --group with %s has not implemented yet", Opts.pszOperation);
     1737        return RTMsgErrorExitFailure("The use of --group with %s has not implemented yet", Opts.pszOperation);
    16261738
    16271739    /*
     
    16441756        case 'u':
    16451757        case RTZIPTARCMD_OPT_DELETE:
    1646             return RTMsgErrorExit(RTEXITCODE_FAILURE, "The operation %s is not implemented yet", Opts.pszOperation);
     1758            return RTMsgErrorExitFailure("The operation %s is not implemented yet", Opts.pszOperation);
    16471759
    16481760        default:
    1649             return RTMsgErrorExit(RTEXITCODE_FAILURE, "Internal error");
     1761            return RTMsgErrorExitFailure("Internal error");
    16501762    }
    16511763}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette