VirtualBox

Changeset 37000 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 7, 2011 8:52:00 PM (14 years ago)
Author:
vboxsync
Message:

Main/linux/USB: correctly handle completely absent /proc/bus/usb

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/linux/USBGetDevices.cpp

    r36994 r37000  
    14991499        PUSBDEVICE pDevices;
    15001500
    1501         fOK = true;
    1502         pDevices = getDevicesFromUsbfs(pcszRoot, true);
    1503         if (pDevices)
    1504         {
    1505             PUSBDEVICE pDevice;
    1506 
    1507             for (pDevice = pDevices; pDevice && fOK; pDevice = pDevice->pNext)
    1508                 if (access(pDevice->pszAddress, R_OK | W_OK))
    1509                     fOK = false;
    1510             deviceListFree(&pDevices);
     1501        if (!access(pcszRoot, R_OK | X_OK))
     1502        {
     1503            fOK = true;
     1504            pDevices = getDevicesFromUsbfs(pcszRoot, true);
     1505            if (pDevices)
     1506            {
     1507                PUSBDEVICE pDevice;
     1508
     1509                for (pDevice = pDevices; pDevice && fOK; pDevice = pDevice->pNext)
     1510                    if (access(pDevice->pszAddress, R_OK | W_OK))
     1511                        fOK = false;
     1512                deviceListFree(&pDevices);
     1513            }
    15111514        }
    15121515    }
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