VirtualBox

Changeset 23382 in vbox


Ignore:
Timestamp:
Sep 28, 2009 2:04:05 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
52907
Message:

Main/HostHardwareLinux: test host floppy drives using an ioctl, not a property which wasn't present in sysfs in older kernels

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/linux/HostHardwareLinux.cpp

    r23310 r23382  
    5353# define _LINUX_BYTEORDER_SWABB_H
    5454# include <linux/cdrom.h>
     55# include <linux/fd.h>
    5556# ifdef VBOX_WITH_DBUS
    5657#  include <vbox-dbus.h>
     
    13041305    void validateAndInitForFloppy()
    13051306    {
    1306         char szBus[128];
     1307        floppy_drive_name szName;
     1308        int rcIoCtl;
    13071309        if (   mpcszName[0] != 'f'
    13081310            || mpcszName[1] != 'd'
     
    13111313            || mpcszName[3] != '\0')
    13121314            return;
    1313         ssize_t cchBus = RTLinuxSysFsGetLinkDest(szBus, sizeof(szBus),
    1314                                                  "block/%s/device/bus",
    1315                                                  mpcszName);
    1316         if (cchBus < 0)
    1317             return;
    1318         if (strcmp(szBus, "platform") != 0)
     1315        RTFILE file;
     1316        int rc = RTFileOpen(&file, mszNode, RTFILE_O_READ);
     1317        /** @note the next line can produce a warning, as the ioctl request
     1318         * field is defined as signed, but the Linux ioctl definition macros
     1319         * produce unsigned constants. */
     1320        rc = RTFileIoCtl(file, FDGETDRVTYP, szName, 0, &rcIoCtl);
     1321        RTFileClose(file);
     1322        if (rcIoCtl < 0)
    13191323            return;
    13201324        misValid = true;
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