VirtualBox

Changeset 6150 in vbox for trunk/src/VBox/Additions/common


Ignore:
Timestamp:
Dec 19, 2007 10:55:09 AM (17 years ago)
Author:
vboxsync
Message:

vboxadd return code and makedevice number fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-solaris.c

    r6147 r6150  
    524524    {
    525525        pState->pSession = pSession;
     526        *pDev = makedevice(getmajor(*pDev), iOpenInstance);
    526527        Log((DEVICE_NAME "VBoxAddSolarisOpen: pSession=%p pState=%p\n", pSession, pState));
    527528        return 0;
     
    547548        RTSpinlockReleaseNoInts(g_Spinlock, &Tmp);
    548549
     550        int instance;
     551        for (instance = 0; instance < 4096; instance++)
     552        {
     553            VBoxAddDevState *pState = ddi_get_soft_state(g_pVBoxAddSolarisState, instance);
     554            if (pState)
     555                break;
     556        }
     557        if (instance >= 4096)
     558        {
     559            Log((DEVICE_NAME ":VBoxAddSolarisOpen: All instances exhausted\n"));
     560            return ENXIO;
     561        }
     562        *pDev = makedevice(getmajor(*pDev), instance);
    549563        Log((DEVICE_NAME "VBoxAddSolarisOpen: g_DevExt=%p pSession=%p rc=%d pid=%d\n", &g_DevExt, pSession, rc, (int)RTProcSelf()));
    550564        return 0;
     
    601615    {
    602616        Log((DEVICE_NAME ":VBoxGuestIoctl: WHUT?!? pSession == NULL! This must be a mistake... pid=%d", (int)Process));
    603         return VERR_INVALID_PARAMETER;
     617        return EFAULT;
    604618    }
    605619#else
     
    609623    {
    610624        Log((DEVICE_NAME ":VBoxAddSolarisClose: failed to get pState.\n"));
    611         return DDI_FAILURE;
     625        return EFAULT;
    612626    }
    613627
     
    618632    {
    619633        Log((DEVICE_NAME ":VBoxAddSolarisClose: failed to get pSession.\n"));
    620         return DDI_FAILURE;
     634        return EFAULT;
    621635    }
    622636#endif
     
    633647{
    634648    LogFlow((DEVICE_NAME ":VBoxAddSolarisRead\n"));
    635     return DDI_SUCCESS;
     649    return 0;
    636650}
    637651
     
    640654{
    641655    LogFlow((DEVICE_NAME ":VBoxAddSolarisWrite\n"));
    642     return DDI_SUCCESS;
     656    return 0;
    643657}
    644658
     
    705719    {
    706720        Log((DEVICE_NAME ":VBoxAddSolarisIOCtl: no session data for %d\n", getminor(Dev)));
    707         return DDI_SUCCESS;
     721        return EINVAL;
    708722    }
    709723#endif
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