VirtualBox

Changeset 77110 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Feb 1, 2019 11:00:12 AM (6 years ago)
Author:
vboxsync
Message:

RTErrConvertFromErrno(): Convert the uNativeCode parameter from unsigned to int. errno is specified to be of type int and while it should only ever contain positive values RTErrConvertFromErrno() is also used inside the various kernel drivers where errno does not exist and the return code might be negative as well. The example here is ERESTART (-1) on FreeBSD causing a compile error with clang and this fix is cleaner IMO instead of casting ERSTART to unsigned.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/err/RTErrConvertFromErrno.cpp

    r76553 r77110  
    3737
    3838
    39 RTDECL(int)  RTErrConvertFromErrno(unsigned uNativeCode)
     39RTDECL(int)  RTErrConvertFromErrno(int iNativeCode)
    4040{
    4141    /* very fast check for no error. */
    42     if (uNativeCode == 0)
     42    if (iNativeCode == 0)
    4343        return VINF_SUCCESS;
    4444
     
    5252     * by RTErrConvertToErrno.
    5353     */
    54     switch (uNativeCode)
     54    switch (iNativeCode)
    5555    {                                                                           /* Linux number */
    5656#ifdef EPERM
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