VirtualBox

Ignore:
Timestamp:
Sep 20, 2007 12:07:28 PM (17 years ago)
Author:
vboxsync
Message:

Added a LogRel with additional driver open info. Return the VERR_VM_DRIVER_* stuff on Solaris, Darwin, FreeBSD and OS/2 as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/darwin/SUPLib-darwin.cpp

    r4882 r4925  
    125125    if (g_hDevice < 0)
    126126    {
    127         int rc = errno;
    128         LogRel(("Failed to open \"%s\", errno=%d\n", rc));
     127        int rc;
     128        switch (errno)
     129        {
     130            case ENODEV:    rc = VERR_VM_DRIVER_LOAD_ERROR; break;
     131            case EPERM:
     132            case EACCES:    rc = VERR_VM_DRIVER_NOT_ACCESSIBLE; break;
     133            case ENOENT:    rc = VERR_VM_DRIVER_NOT_INSTALLED; break;
     134            default:        rc = VERR_VM_DRIVER_OPEN_ERROR; break;
     135        }
     136        LogRel(("Failed to open \"%s\", errno=%d, rc=%Vrc\n", DEVICE_NAME, errno, rc));
     137
    129138        kr = IOServiceClose(g_Connection);
    130139        if (kr != kIOReturnSuccess)
    131140            LogRel(("Warning: IOServiceClose(%p) returned %d\n", g_Connection, kr));
    132         return RTErrConvertFromErrno(rc);
     141        return rc;
    133142    }
    134143
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