VirtualBox

Changeset 37596 in vbox for trunk/src/VBox/Devices/USB/linux


Ignore:
Timestamp:
Jun 22, 2011 7:30:06 PM (13 years ago)
Author:
vboxsync
Message:

*: RTFILE becomes a pointer, RTFileOpen++ expands it's flags paramter from uint32_t to uint64_t.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/USB/linux/USBProxyDevice-linux.cpp

    r35346 r37596  
    137137{
    138138    /** The open file. */
    139     RTFILE              File;
     139    RTFILE              hFile;
    140140    /** Critical section protecting the two lists. */
    141141    RTCRITSECT          CritSect;
     
    194194        do
    195195        {
    196             rc = ioctl(pDevLnx->File, iCmd, pvArg);
     196            rc = ioctl(RTFileToNative(pDevLnx->hFile), iCmd, pvArg);
    197197            if (rc >= 0)
    198198                return rc;
     
    236236        pUrbLnx = pUrbLnx->pNext;
    237237
    238         ioctl(pDevLnx->File, USBDEVFS_DISCARDURB, &pCur->KUrb); /* not sure if this is required.. */
     238        ioctl(RTFileToNative(pDevLnx->hFile), USBDEVFS_DISCARDURB, &pCur->KUrb); /* not sure if this is required.. */
    239239        if (!pCur->KUrb.status)
    240240            pCur->KUrb.status = -ENODEV;
     
    596596{
    597597    PUSBPROXYDEVLNX pDevLnx = (PUSBPROXYDEVLNX)pProxyDev->Backend.pv;
    598     AssertReturn(pDevLnx->File != NIL_RTFILE, -1);
    599     return pDevLnx->File;
     598    AssertReturn(pDevLnx->hFile != NIL_RTFILE, -1);
     599    return RTFileToNative(pDevLnx->hFile);
    600600}
    601601
     
    653653     * Try open the device node.
    654654     */
    655     RTFILE File;
    656     int rc = RTFileOpen(&File, pszDevNode, RTFILE_O_READWRITE | RTFILE_O_OPEN | RTFILE_O_DENY_NONE);
     655    RTFILE hFile;
     656    int rc = RTFileOpen(&hFile, pszDevNode, RTFILE_O_READWRITE | RTFILE_O_OPEN | RTFILE_O_DENY_NONE);
    657657    if (RT_SUCCESS(rc))
    658658    {
     
    666666            memcpy(&pDevLnx->szPath[0], pszPath, cchPath);
    667667            pDevLnx->szPath[cchPath] = '\0';
    668             pDevLnx->File = File;
     668            pDevLnx->hFile = hFile;
    669669            rc = RTCritSectInit(&pDevLnx->CritSect);
    670670            if (RT_SUCCESS(rc))
     
    672672                pProxyDev->Backend.pv = pDevLnx;
    673673
    674                 LogFlow(("usbProxyLinuxOpen(%p, %s): returns successfully File=%d iActiveCfg=%d\n",
    675                          pProxyDev, pszAddress, pDevLnx->File, pProxyDev->iActiveCfg));
     674                LogFlow(("usbProxyLinuxOpen(%p, %s): returns successfully File=%RTfile iActiveCfg=%d\n",
     675                         pProxyDev, pszAddress, pDevLnx->hFile, pProxyDev->iActiveCfg));
    676676
    677677                return VINF_SUCCESS;
     
    682682        else
    683683            rc = VERR_NO_MEMORY;
    684         RTFileClose(File);
     684        RTFileClose(hFile);
    685685    }
    686686    else if (rc == VERR_ACCESS_DENIED)
     
    812812    }
    813813
    814     RTFileClose(pDevLnx->File);
    815     pDevLnx->File = NIL_RTFILE;
     814    RTFileClose(pDevLnx->hFile);
     815    pDevLnx->hFile = NIL_RTFILE;
    816816
    817817    RTMemFree(pDevLnx);
     
    12781278    unsigned        cTries = 0;
    12791279
    1280     while (ioctl(pDevLnx->File, USBDEVFS_SUBMITURB, &pCur->KUrb))
     1280    while (ioctl(RTFileToNative(pDevLnx->hFile), USBDEVFS_SUBMITURB, &pCur->KUrb))
    12811281    {
    12821282        if (errno == EINTR)
     
    15161516     */
    15171517    cTries = 0;
    1518     while (ioctl(pDevLnx->File, USBDEVFS_SUBMITURB, &pUrbLnx->KUrb))
     1518    while (ioctl(RTFileToNative(pDevLnx->hFile), USBDEVFS_SUBMITURB, &pUrbLnx->KUrb))
    15191519    {
    15201520        if (errno == EINTR)
     
    17601760            {
    17611761                struct pollfd pfd;
    1762                 int rc;
    1763 
    1764                 pfd.fd = pDevLnx->File;
     1762                pfd.fd = RTFileToNative(pDevLnx->hFile);
    17651763                pfd.events = POLLOUT | POLLWRNORM /* completed async */
    17661764                           | POLLERR | POLLHUP    /* disconnected */;
    17671765                pfd.revents = 0;
    1768                 rc = poll(&pfd, 1, cMillies);
     1766                int rc = poll(&pfd, 1, cMillies);
    17691767                Log(("usbProxyLinuxUrbReap: poll rc = %d\n", rc));
    17701768                if (rc >= 1)
     
    17901788        {
    17911789            struct usbdevfs_urb *pKUrb;
    1792             while (ioctl(pDevLnx->File, USBDEVFS_REAPURBNDELAY, &pKUrb))
     1790            while (ioctl(RTFileToNative(pDevLnx->hFile), USBDEVFS_REAPURBNDELAY, &pKUrb))
    17931791                if (errno != EINTR)
    17941792                {
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