VirtualBox

Changeset 69749 in vbox


Ignore:
Timestamp:
Nov 19, 2017 12:49:36 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
119149
Message:

Changed RTLogCreateEx[V] to take a RTERRINFO pointer rather than plain char * and size_t. Turned out a several callers didn't actually make use of the error message even.

Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/com/com.h

    r69107 r69749  
    9999 *  @param uHistoryFileTime Maximum amount of time to put in a log file.
    100100 *  @param uHistoryFileSize Maximum size of a log file before rotating.
    101  *  @param pszError         In case of creation failure: buffer for error message.
    102  *  @param cbError          Size of error message buffer.
     101 *  @param pErrInfo         Where to return extended error information.
     102 *                          Optional.
     103 *
    103104 *  @return         VBox status code.
    104105 */
     
    108109                     uint32_t cMaxEntriesPerGroup, uint32_t cHistory,
    109110                     uint32_t uHistoryFileTime, uint64_t uHistoryFileSize,
    110                      char *pszError, size_t cbError);
     111                     PRTERRINFO pErrInfo);
    111112
    112113} /* namespace com */
  • trunk/include/iprt/log.h

    r69745 r69749  
    20202020 *                              performing history rotation, in seconds.
    20212021 *                              0 means time limit.
    2022  * @param   pszErrorMsg         A buffer which is filled with an error message if something fails. May be NULL.
    2023  * @param   cchErrorMsg         The size of the error message buffer.
     2022 * @param   pErrInfo            Where to return extended error information.
     2023 *                              Optional.
    20242024 * @param   pszFilenameFmt      Log filename format string. Standard RTStrFormat().
    20252025 * @param   ...                 Format arguments.
     
    20282028                          const char *pszEnvVarBase, unsigned cGroups, const char * const * papszGroups,
    20292029                          uint32_t fDestFlags, PFNRTLOGPHASE pfnPhase, uint32_t cHistory,
    2030                           uint64_t cbHistoryFileMax, uint32_t cSecsHistoryTimeSlot, char *pszErrorMsg, size_t cchErrorMsg,
     2030                          uint64_t cbHistoryFileMax, uint32_t cSecsHistoryTimeSlot, PRTERRINFO pErrInfo,
    20312031                          const char *pszFilenameFmt, ...) RT_IPRT_FORMAT_ATTR_MAYBE_NULL(14, 15);
    20322032
     
    20572057 *                              performing history rotation, in seconds.
    20582058 *                              0 means no time limit.
    2059  * @param   pszErrorMsg         A buffer which is filled with an error message
    2060  *                              if something fails.  May be NULL.
    2061  * @param   cchErrorMsg         The size of the error message buffer.
     2059 * @param   pErrInfo            Where to return extended error information.
     2060 *                              Optional.
    20622061 * @param   pszFilenameFmt      Log filename format string.  Standard
    20632062 *                              RTStrFormat().
     
    20672066                           const char *pszEnvVarBase, unsigned cGroups, const char * const * papszGroups,
    20682067                           uint32_t fDestFlags, PFNRTLOGPHASE pfnPhase, uint32_t cHistory,
    2069                            uint64_t cbHistoryFileMax, uint32_t cSecsHistoryTimeSlot, char *pszErrorMsg, size_t cchErrorMsg,
     2068                           uint64_t cbHistoryFileMax, uint32_t cSecsHistoryTimeSlot, PRTERRINFO pErrInfo,
    20702069                           const char *pszFilenameFmt, va_list args) RT_IPRT_FORMAT_ATTR_MAYBE_NULL(14, 0);
    20712070
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.cpp

    r69500 r69749  
    559559    fFlags |= RTLOGFLAGS_USECRLF;
    560560#endif
    561     char szError[RTPATH_MAX + 128] = "";
     561    RTERRINFOSTATIC ErrInfo;
    562562    int rc = RTLogCreateEx(&g_pLoggerRelease, fFlags,
    563563#ifdef DEBUG
     
    570570                           RT_ELEMENTS(s_apszGroups), s_apszGroups, RTLOGDEST_STDOUT,
    571571                           vboxTrayLogHeaderFooter, g_cHistory, g_uHistoryFileSize, g_uHistoryFileTime,
    572                            szError, sizeof(szError), pszLogFile);
     572                           RTErrInfoInitStatic(&ErrInfo), pszLogFile);
    573573    if (RT_SUCCESS(rc))
    574574    {
     
    583583    }
    584584    else
    585         MessageBox(GetDesktopWindow(),
    586                    szError, "VBoxTray - Logging Error", MB_OK | MB_ICONERROR);
     585        MessageBoxA(GetDesktopWindow(), ErrInfo.szMsg, "VBoxTray - Logging Error", MB_OK | MB_ICONERROR);
    587586
    588587    return rc;
  • trunk/src/VBox/Additions/common/VBoxService/VBoxService.cpp

    r69500 r69749  
    310310    fFlags |= RTLOGFLAGS_USECRLF;
    311311#endif
    312     char szError[RTPATH_MAX + 128] = "";
    313312    int rc = RTLogCreateEx(&g_pLoggerRelease, fFlags, "all",
    314313#ifdef DEBUG
     
    320319                           RTLOGDEST_STDOUT | RTLOGDEST_USER,
    321320                           vgsvcLogHeaderFooter, g_cHistory, g_uHistoryFileSize, g_uHistoryFileTime,
    322                            szError, sizeof(szError), pszLogFile);
     321                           NULL /*pErrInfo*/, pszLogFile);
    323322    if (RT_SUCCESS(rc))
    324323    {
  • trunk/src/VBox/Additions/linux/lightdm-greeter/vbox-greeter.cpp

    r69500 r69749  
    936936    fFlags |= RTLOGFLAGS_USECRLF;
    937937#endif
    938     char szError[RTPATH_MAX + 128] = "";
    939938    int rc = RTLogCreateEx(&g_pLoggerRelease, fFlags, "all",
    940939                           "VBOXGREETER_RELEASE_LOG", RT_ELEMENTS(s_apszGroups), s_apszGroups,
    941940                           RTLOGDEST_STDOUT,
    942941                           vboxGreeterLogHeaderFooter, g_cHistory, g_uHistoryFileSize, g_uHistoryFileTime,
    943                            szError, sizeof(szError), pszLogFile);
     942                           NULL /*pErrInfo*/, pszLogFile);
    944943    if (RT_SUCCESS(rc))
    945944    {
  • trunk/src/VBox/Frontends/VBoxBalloonCtrl/VBoxWatchdog.cpp

    r69500 r69749  
    10991099
    11001100    /* create release logger, to stdout */
    1101     char szError[RTPATH_MAX + 128];
     1101    RTERRINFOSTATIC ErrInfo;
    11021102    rc = com::VBoxLogRelCreate("Watchdog", g_fDaemonize ? NULL : pszLogFile,
    11031103                               RTLOGFLAGS_PREFIX_THREAD | RTLOGFLAGS_PREFIX_TIME_PROG,
     
    11051105                               RTLOGDEST_STDOUT, UINT32_MAX /* cMaxEntriesPerGroup */,
    11061106                               g_cHistory, g_uHistoryFileTime, g_uHistoryFileSize,
    1107                                szError, sizeof(szError));
     1107                               RTErrInfoInitStatic(&ErrInfo));
    11081108    if (RT_FAILURE(rc))
    1109         return RTMsgErrorExit(RTEXITCODE_FAILURE, "failed to open release log (%s, %Rrc)", szError, rc);
     1109        return RTMsgErrorExit(RTEXITCODE_FAILURE, "failed to open release log (%s, %Rrc)", ErrInfo.Core.pszMsg, rc);
    11101110
    11111111#if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) || defined (RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
     
    11351135                                   RTLOGDEST_FILE, UINT32_MAX /* cMaxEntriesPerGroup */,
    11361136                                   g_cHistory, g_uHistoryFileTime, g_uHistoryFileSize,
    1137                                    szError, sizeof(szError));
     1137                                   RTErrInfoInitStatic(&ErrInfo));
    11381138        if (RT_FAILURE(rc))
    1139             return RTMsgErrorExit(RTEXITCODE_FAILURE, "failed to open release log (%s, %Rrc)", szError, rc);
     1139            return RTMsgErrorExit(RTEXITCODE_FAILURE, "failed to open release log (%s, %Rrc)", ErrInfo.Core.pszMsg, rc);
    11401140    }
    11411141#endif
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r69615 r69749  
    38593859        pszLogFile = szLogFile;
    38603860        /* Create release logger, to file: */
    3861         char szError[RTPATH_MAX + 128];
    38623861        com::VBoxLogRelCreate("GUI VM Selector Window",
    38633862                              pszLogFile,
     
    38703869                              60 * 60,
    38713870                              _1M,
    3872                               szError,
    3873                               sizeof(szError));
     3871                              NULL /*pErrInfo*/);
    38743872
    38753873        LogRel(("Qt version: %s\n", qtRTVersionString().toUtf8().constData()));
  • trunk/src/VBox/HostServices/SharedOpenGL/OpenGLTest/OpenGLTestApp.cpp

    r69500 r69749  
    115115    fFlags |= RTLOGFLAGS_USECRLF;
    116116#endif
    117     char szError[RTPATH_MAX + 128] = "";
    118117    const char * pszFilenameFmt;
    119118    RTLOGDEST enmLogDest;
     
    135134                            "VBOX_RELEASE_LOG", RT_ELEMENTS(s_apszGroups), s_apszGroups, enmLogDest,
    136135                            NULL /* pfnBeginEnd */, 0 /* cHistory */, 0 /* cbHistoryFileMax */, 0 /* uHistoryTimeMax */,
    137                             szError, sizeof(szError), pszFilenameFmt, pszFilename, RTTimeMilliTS());
     136                            NULL /* pErrInfo */, pszFilenameFmt, pszFilename, RTTimeMilliTS());
    138137    if (RT_SUCCESS(vrc))
    139138    {
  • trunk/src/VBox/Main/glue/VBoxLogRelCreate.cpp

    r69500 r69749  
    141141                     uint32_t cMaxEntriesPerGroup, uint32_t cHistory,
    142142                     uint32_t uHistoryFileTime, uint64_t uHistoryFileSize,
    143                      char *pszError, size_t cbError)
     143                     PRTERRINFO pErrInfo)
    144144{
    145     Assert(cbError >= RTPATH_MAX + 128);
    146 
    147145    /* create release logger */
    148146    PRTLOGGER pReleaseLogger;
     
    155153                            pcszEnvVarBase, RT_ELEMENTS(s_apszGroups), s_apszGroups, fDestFlags,
    156154                            vboxHeaderFooter, cHistory, uHistoryFileSize, uHistoryFileTime,
    157                             pszError, cbError,
    158                             pcszLogFile ? "%s" : NULL, pcszLogFile);
     155                            pErrInfo, pcszLogFile ? "%s" : NULL, pcszLogFile);
    159156    if (RT_SUCCESS(vrc))
    160157    {
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r69046 r69749  
    72177217    }
    72187218
    7219     char szError[RTPATH_MAX + 128];
     7219    RTERRINFOSTATIC ErrInfo;
    72207220    int vrc = com::VBoxLogRelCreate("VM", logFile.c_str(),
    72217221                                    RTLOGFLAGS_PREFIX_TIME_PROG | RTLOGFLAGS_RESTRICT_GROUPS,
     
    72247224                                    32768 /* cMaxEntriesPerGroup */,
    72257225                                    0 /* cHistory */, 0 /* uHistoryFileTime */,
    7226                                     0 /* uHistoryFileSize */, szError, sizeof(szError));
     7226                                    0 /* uHistoryFileSize */, RTErrInfoInitStatic(&ErrInfo));
    72277227    if (RT_FAILURE(vrc))
    7228         hrc = setError(E_FAIL, tr("Failed to open release log (%s, %Rrc)"),
    7229                        szError, vrc);
     7228        hrc = setError(E_FAIL, tr("Failed to open release log (%s, %Rrc)"), ErrInfo.Core.pszMsg, vrc);
    72307229
    72317230    /* If we've made any directory changes, flush the directory to increase
  • trunk/src/VBox/Main/src-server/win/svcmain.cpp

    r69747 r69749  
    809809        }
    810810
    811         char szError[RTPATH_MAX + 128];
     811        RTERRINFOSTATIC ErrInfo;
    812812        vrc = com::VBoxLogRelCreate("COM Server", pszLogFile,
    813813                                    RTLOGFLAGS_PREFIX_THREAD | RTLOGFLAGS_PREFIX_TIME_PROG,
     
    819819#endif
    820820                                    UINT32_MAX /* cMaxEntriesPerGroup */, cHistory, uHistoryFileTime, uHistoryFileSize,
    821                                     szError, sizeof(szError));
     821                                    RTErrInfoInitStatic(&ErrInfo));
    822822        if (RT_FAILURE(vrc))
    823             return RTMsgErrorExit(RTEXITCODE_FAILURE, "failed to open release log (%s, %Rrc)", szError, vrc);
     823            return RTMsgErrorExit(RTEXITCODE_FAILURE, "failed to open release log (%s, %Rrc)", ErrInfo.Core.pszMsg, vrc);
    824824    }
    825825
  • trunk/src/VBox/Main/src-server/xpcom/server.cpp

    r65420 r69749  
    744744        return RTMsgErrorExit(RTEXITCODE_FAILURE, "failed to create logging file name, rc=%Rrc", vrc);
    745745
    746     char szError[RTPATH_MAX + 128];
     746    RTERRINFOSTATIC ErrInfo;
    747747    vrc = com::VBoxLogRelCreate("XPCOM Server", szLogFile,
    748748                                RTLOGFLAGS_PREFIX_THREAD | RTLOGFLAGS_PREFIX_TIME_PROG,
     
    750750                                RTLOGDEST_FILE, UINT32_MAX /* cMaxEntriesPerGroup */,
    751751                                cHistory, uHistoryFileTime, uHistoryFileSize,
    752                                 szError, sizeof(szError));
     752                                RTErrInfoInitStatic(&ErrInfo));
    753753    if (RT_FAILURE(vrc))
    754         return RTMsgErrorExit(RTEXITCODE_FAILURE, "failed to open release log (%s, %Rrc)", szError, vrc);
     754        return RTMsgErrorExit(RTEXITCODE_FAILURE, "failed to open release log (%s, %Rrc)", ErrInfo.Core.pszMsg, vrc);
    755755
    756756    /* Set up a build identifier so that it can be seen from core dumps what
  • trunk/src/VBox/Main/webservice/vboxweb.cpp

    r69500 r69749  
    12091209
    12101210    /* create release logger, to stdout */
    1211     char szError[RTPATH_MAX + 128];
     1211    RTERRINFOSTATIC ErrInfo;
    12121212    rc = com::VBoxLogRelCreate("web service", g_fDaemonize ? NULL : pszLogFile,
    12131213                               RTLOGFLAGS_PREFIX_THREAD | RTLOGFLAGS_PREFIX_TIME_PROG,
     
    12151215                               RTLOGDEST_STDOUT, UINT32_MAX /* cMaxEntriesPerGroup */,
    12161216                               g_cHistory, g_uHistoryFileTime, g_uHistoryFileSize,
    1217                                szError, sizeof(szError));
     1217                               RTErrInfoInitStatic(&ErrInfo));
    12181218    if (RT_FAILURE(rc))
    1219         return RTMsgErrorExit(RTEXITCODE_FAILURE, "failed to open release log (%s, %Rrc)", szError, rc);
     1219        return RTMsgErrorExit(RTEXITCODE_FAILURE, "failed to open release log (%s, %Rrc)", ErrInfo.Core.pszMsg, rc);
    12201220
    12211221#if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) || defined (RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
     
    12461246                                   RTLOGDEST_FILE, UINT32_MAX /* cMaxEntriesPerGroup */,
    12471247                                   g_cHistory, g_uHistoryFileTime, g_uHistoryFileSize,
    1248                                    szError, sizeof(szError));
     1248                                   RTErrInfoInitStatic(&ErrInfo));
    12491249        if (RT_FAILURE(rc))
    1250             return RTMsgErrorExit(RTEXITCODE_FAILURE, "failed to open release log (%s, %Rrc)", szError, rc);
     1250            return RTMsgErrorExit(RTEXITCODE_FAILURE, "failed to open release log (%s, %Rrc)", ErrInfo.Core.pszMsg, rc);
    12511251    }
    12521252#endif
  • trunk/src/VBox/NetworkServices/NAT/VBoxNetLwipNAT.cpp

    r69500 r69749  
    13251325        return VERR_BUFFER_OVERFLOW;
    13261326
    1327     char szError[RTPATH_MAX + 128];
    13281327    rc = com::VBoxLogRelCreate("NAT Network",
    13291328                               szLogFile,
     
    13361335                               0 /* uHistoryFileTime */,
    13371336                               0 /* uHistoryFileSize */,
    1338                                szError, sizeof(szError));
     1337                               NULL /*pErrInfo*/);
    13391338
    13401339    /*
  • trunk/src/VBox/Runtime/common/log/log.cpp

    r69746 r69749  
    228228#endif
    229229#ifdef IN_RING3
    230 static int  rtR3LogOpenFileDestination(PRTLOGGER pLogger, char *pszErrorMsg, size_t cchErrorMsg);
     230static int  rtR3LogOpenFileDestination(PRTLOGGER pLogger, PRTERRINFO pErrInfo);
    231231#endif
    232232#ifndef IN_RC
     
    781781                           uint32_t fDestFlags, PFNRTLOGPHASE pfnPhase, uint32_t cHistory,
    782782                           uint64_t cbHistoryFileMax, uint32_t cSecsHistoryTimeSlot,
    783                            char *pszErrorMsg, size_t cchErrorMsg, const char *pszFilenameFmt, va_list args)
     783                           PRTERRINFO pErrInfo, const char *pszFilenameFmt, va_list args)
    784784{
    785785    int         rc;
     
    791791     * Validate input.
    792792     */
    793     if (    (cGroups && !papszGroups)
    794         ||  !VALID_PTR(ppLogger) )
     793    if (   (cGroups && !papszGroups)
     794        || !VALID_PTR(ppLogger) )
    795795    {
    796796        AssertMsgFailed(("Invalid parameters!\n"));
     
    798798    }
    799799    *ppLogger = NULL;
    800 
    801     if (pszErrorMsg)
    802         RTStrPrintf(pszErrorMsg, cchErrorMsg, N_("unknown error"));
    803800
    804801    AssertMsgReturn(cHistory < _1M, ("%#x", cHistory), VERR_OUT_OF_RANGE);
     
    882879        else
    883880        {
     881            rc = VERR_NO_MEMORY;
    884882#  ifdef RT_OS_LINUX
    885             if (pszErrorMsg) /* Most probably SELinux causing trouble since the larger RTMemAlloc succeeded. */
    886                 RTStrPrintf(pszErrorMsg, cchErrorMsg, N_("mmap(PROT_WRITE | PROT_EXEC) failed -- SELinux?"));
     883                /* Most probably SELinux causing trouble since the larger RTMemAlloc succeeded. */
     884            RTErrInfoSet(rc, N_("mmap(PROT_WRITE | PROT_EXEC) failed -- SELinux?"));
    887885#  endif
    888             rc = VERR_NO_MEMORY;
    889886        }
    890887        if (RT_SUCCESS(rc))
     
    948945# ifdef IN_RING3
    949946            if ((pLogger->fDestFlags & (RTLOGDEST_FILE | RTLOGDEST_F_DELAY_FILE)) == RTLOGDEST_FILE)
    950                 rc = rtR3LogOpenFileDestination(pLogger, pszErrorMsg, cchErrorMsg);
     947                rc = rtR3LogOpenFileDestination(pLogger, pErrInfo);
    951948# endif
    952949
     
    984981                }
    985982
    986                 if (pszErrorMsg)
    987                     RTStrPrintf(pszErrorMsg, cchErrorMsg, N_("failed to create semaphore"));
     983                RTErrInfoSet(pErrInfo, rc, N_("failed to create semaphore"));
    988984            }
    989985# ifdef IN_RING3
     
    10161012    rc = RTLogCreateExV(ppLogger, fFlags, pszGroupSettings, pszEnvVarBase, cGroups, papszGroups,
    10171013                        fDestFlags, NULL /*pfnPhase*/, 0 /*cHistory*/, 0 /*cbHistoryFileMax*/, 0 /*cSecsHistoryTimeSlot*/,
    1018                         NULL /*pszErrorMsg*/, 0 /*cchErrorMsg*/, pszFilenameFmt, args);
     1014                        NULL /*pErrInfo*/, pszFilenameFmt, args);
    10191015    va_end(args);
    10201016    return rc;
     
    10271023                          uint32_t fDestFlags, PFNRTLOGPHASE pfnPhase, uint32_t cHistory,
    10281024                          uint64_t cbHistoryFileMax, uint32_t cSecsHistoryTimeSlot,
    1029                           char *pszErrorMsg, size_t cchErrorMsg, const char *pszFilenameFmt, ...)
     1025                          PRTERRINFO pErrInfo, const char *pszFilenameFmt, ...)
    10301026{
    10311027    va_list args;
     
    10351031    rc = RTLogCreateExV(ppLogger, fFlags, pszGroupSettings, pszEnvVarBase, cGroups, papszGroups,
    10361032                        fDestFlags, pfnPhase, cHistory, cbHistoryFileMax, cSecsHistoryTimeSlot,
    1037                         pszErrorMsg, cchErrorMsg, pszFilenameFmt, args);
     1033                        pErrInfo, pszFilenameFmt, args);
    10381034    va_end(args);
    10391035    return rc;
     
    24582454                && pLogger->pInt->hFile == NIL_RTFILE)
    24592455            {
    2460                 rc = rtR3LogOpenFileDestination(pLogger, NULL, 0);
     2456                rc = rtR3LogOpenFileDestination(pLogger, pErrInfo);
    24612457                if (RT_SUCCESS(rc))
    24622458                    rtlogFlush(pLogger, false /*fNeedSpace*/);
     
    31743170 *
    31753171 * @param   pLogger         The logger instance to update. NULL is not allowed!
    3176  * @param   pszErrorMsg     A buffer which is filled with an error message if
    3177  *                          something fails.  May be NULL.
    3178  * @param   cchErrorMsg     The size of the error message buffer.
    3179  */
    3180 static int rtlogFileOpen(PRTLOGGER pLogger, char *pszErrorMsg, size_t cchErrorMsg)
     3172 * @param   pErrInfo        Where to return extended error information.
     3173 *                          Optional.
     3174 */
     3175static int rtlogFileOpen(PRTLOGGER pLogger, PRTERRINFO pErrInfo)
    31813176{
    31823177    uint32_t fOpen = RTFILE_O_WRITE | RTFILE_O_DENY_NONE;
     
    32113206    {
    32123207        pLogger->pInt->hFile = NIL_RTFILE;
    3213         if (pszErrorMsg)
    3214             RTStrPrintf(pszErrorMsg, cchErrorMsg, N_("could not open file '%s' (fOpen=%#x)"), pLogger->pInt->szFilename, fOpen);
     3208        RTErrInfoSetF(pErrInfo, rc, N_("could not open file '%s' (fOpen=%#x)"), pLogger->pInt->szFilename, fOpen);
    32153209    }
    32163210    return rc;
     
    32283222 *                      called from RTLogCreateExV.  Prevents pfnPhase from
    32293223 *                      being called.
    3230  */
    3231 static void rtlogRotate(PRTLOGGER pLogger, uint32_t uTimeSlot, bool fFirst)
     3224 * @param   pErrInfo    Where to return extended error information. Optional.
     3225 */
     3226static void rtlogRotate(PRTLOGGER pLogger, uint32_t uTimeSlot, bool fFirst, PRTERRINFO pErrInfo)
    32323227{
    32333228    /* Suppress rotating empty log files simply because the time elapsed. */
     
    33213316    pLogger->pInt->cbHistoryFileWritten = 0;
    33223317    pLogger->pInt->uHistoryTimeSlotStart = uTimeSlot;
    3323     rtlogFileOpen(pLogger, NULL, 0);
     3318    rtlogFileOpen(pLogger, pErrInfo);
    33243319
    33253320    /*
     
    33493344 * @returns IPRT status code.
    33503345 * @param   pLogger             The logger.
    3351  * @param   pszErrorMsg         Where to return error info. Optional.
    3352  * @param   cchErrorMsg         Size of @a pszErrorMsg buffer.
    3353  */
    3354 static int rtR3LogOpenFileDestination(PRTLOGGER pLogger, char *pszErrorMsg, size_t cchErrorMsg)
     3346 * @param   pErrInfo            Where to return extended error information.
     3347 *                              Optional.
     3348 */
     3349static int rtR3LogOpenFileDestination(PRTLOGGER pLogger, PRTERRINFO pErrInfo)
    33553350{
    33563351    int rc;
    33573352    if (pLogger->fFlags & RTLOGFLAGS_APPEND)
    33583353    {
    3359         rc = rtlogFileOpen(pLogger, pszErrorMsg, cchErrorMsg);
     3354        rc = rtlogFileOpen(pLogger, pErrInfo);
    33603355
    33613356        /* Rotate in case of appending to a too big log file,
    33623357           otherwise this simply doesn't do anything. */
    3363         rtlogRotate(pLogger, 0, true /* fFirst */);
     3358        rtlogRotate(pLogger, 0, true /* fFirst */, pErrInfo);
    33643359    }
    33653360    else
     
    33673362        /* Force rotation if it is configured. */
    33683363        pLogger->pInt->cbHistoryFileWritten = UINT64_MAX;
    3369         rtlogRotate(pLogger, 0, true /* fFirst */);
     3364        rtlogRotate(pLogger, 0, true /* fFirst */, pErrInfo);
    33703365
    33713366        /* If the file is not open then rotation is not set up. */
     
    33733368        {
    33743369            pLogger->pInt->cbHistoryFileWritten = 0;
    3375             rc = rtlogFileOpen(pLogger, pszErrorMsg, cchErrorMsg);
     3370            rc = rtlogFileOpen(pLogger, pErrInfo);
    33763371        }
    33773372        else
     
    34813476        if (   (pLogger->fDestFlags & RTLOGDEST_FILE)
    34823477            && pLogger->pInt->cHistory)
    3483             rtlogRotate(pLogger, RTTimeProgramSecTS() / pLogger->pInt->cSecsHistoryTimeSlot, false /* fFirst */);
     3478            rtlogRotate(pLogger, RTTimeProgramSecTS() / pLogger->pInt->cSecsHistoryTimeSlot, false /*fFirst*/, NULL /*pErrInfo*/);
    34843479#endif
    34853480    }
Note: See TracChangeset for help on using the changeset viewer.

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