VirtualBox

Changeset 26674 in vbox


Ignore:
Timestamp:
Feb 22, 2010 9:41:17 AM (15 years ago)
Author:
vboxsync
Message:

iprt: Added RTMsgInitFailure for dealing with RTR3Init failures.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/message.h

    r24825 r26674  
    7070RTDECL(int)  RTMsgErrorV(const char *pszFormat, va_list va);
    7171
     72/**
     73 * Print an error message for a RTR3Init failure and suggest an exit code.
     74 *
     75 * @code
     76 *
     77 * int rc = RTR3Init();
     78 * if (RT_FAILURE(rc))
     79 *     return RTMsgInitFailure(rc);
     80 *
     81 * @endcode
     82 *
     83 * @returns Appropriate exit code.
     84 * @param   rcRTR3Init      The status code returned by RTR3Init.
     85 */
     86RTDECL(int)  RTMsgInitFailure(int rcRTR3Init);
     87
    7288/** @} */
    7389
  • trunk/src/VBox/Runtime/common/misc/message.cpp

    r26344 r26674  
    9898RT_EXPORT_SYMBOL(RTMsgErrorV);
    9999
     100
     101RTDECL(int) RTMsgInitFailure(int rcRTR3Init)
     102{
     103    if (   g_offrtProcName
     104        && g_offrtProcName < sizeof(g_szrtProcExePath)
     105        && g_szrtProcExePath[0]
     106        && g_szrtProcExePath[g_offrtProcName])
     107        RTStrmPrintf(g_pStdErr, "%s: fatal error: RTR3Init: %Rrc\n", &g_szrtProcExePath[g_offrtProcName], rcRTR3Init);
     108    else
     109        RTStrmPrintf(g_pStdErr, "fatal error: RTR3Init: %Rrc\n", rcRTR3Init);
     110    return 12;
     111}
     112RT_EXPORT_SYMBOL(RTMsgInitFailure);
     113
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