VirtualBox

Changeset 8017 in vbox


Ignore:
Timestamp:
Apr 16, 2008 7:54:25 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
29675
Message:

Solaris hostdvd: attempt to better mediachanged detection.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DrvHostDVD.cpp

    r5999 r8017  
    332332
    333333    /* Need to pass the previous state and DKIO_NONE for the first time. */
    334     static dkio_state DeviceState = DKIO_NONE;
    335     int rc2 = ioctl(pThis->FileRawDevice, DKIOCSTATE, &DeviceState);
     334    static dkio_state s_DeviceState = DKIO_NONE;
     335    dkio_state PreviousState = s_DeviceState;
     336    int rc2 = ioctl(pThis->FileRawDevice, DKIOCSTATE, &s_DeviceState);
    336337    if (rc2 == 0)
    337338    {
    338         fMediaPresent = DeviceState == DKIO_INSERTED;
    339         if (pThis->fMediaPresent != fMediaPresent || !fMediaPresent)
    340             fMediaChanged = true;   /** @todo find proper way to detect media change. */
    341     }
     339        fMediaPresent = (s_DeviceState == DKIO_INSERTED);
     340        if (PreviousState != s_DeviceState)
     341            fMediaChanged = true;
     342    }
     343    else
     344        fMediaChanged = true;
    342345
    343346#else
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette