diff options
author | Johannes Schickel | 2016-03-21 04:42:10 +0100 |
---|---|---|
committer | Johannes Schickel | 2016-03-21 04:42:13 +0100 |
commit | 99bb62f0e99f3c63c1d5cbae4f70dff6d5ff0868 (patch) | |
tree | b9edc8d29f88e28ad2acdd4a24ab2c83716e3294 /backends | |
parent | ce1be463c2dfea61e74a816d6590a1a4506483d2 (diff) | |
download | scummvm-rg350-99bb62f0e99f3c63c1d5cbae4f70dff6d5ff0868.tar.gz scummvm-rg350-99bb62f0e99f3c63c1d5cbae4f70dff6d5ff0868.tar.bz2 scummvm-rg350-99bb62f0e99f3c63c1d5cbae4f70dff6d5ff0868.zip |
LINUX: Use classic major/minor macros.
Makes our Linux Audio CD code work with implementations without gnu_dev_major
and gnu_dev_minor too.
Diffstat (limited to 'backends')
-rw-r--r-- | backends/audiocd/linux/linux-audiocd.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/backends/audiocd/linux/linux-audiocd.cpp b/backends/audiocd/linux/linux-audiocd.cpp index a5838e1c5a..caa0265637 100644 --- a/backends/audiocd/linux/linux-audiocd.cpp +++ b/backends/audiocd/linux/linux-audiocd.cpp @@ -62,6 +62,7 @@ #include <linux/cdrom.h> #include <sys/ioctl.h> #include <sys/stat.h> +#include <sys/types.h> enum { kLeadoutTrack = 0xAA @@ -379,8 +380,9 @@ bool LinuxAudioCDManager::tryAddDrive(DeviceList &devices, const Common::String bool LinuxAudioCDManager::tryAddDrive(DeviceList &devices, dev_t device) { // Construct the block name - // (Does anyone have a better way to do this? bdevname is kernel only) - Common::String name = Common::String::format("/dev/block/%d:%d", gnu_dev_major(device), gnu_dev_minor(device)); + // TODO: libblkid's blkid_devno_to_devname is exactly what we look for. + // This requires an external dependency though. + Common::String name = Common::String::format("/dev/block/%d:%d", major(device), minor(device)); return tryAddDrive(devices, name, device); } |