Skip to content

Commit

Permalink
LINUX: Use classic major/minor macros.
Browse files Browse the repository at this point in the history
Makes our Linux Audio CD code work with implementations without gnu_dev_major
and gnu_dev_minor too.
  • Loading branch information
Johannes Schickel committed Mar 21, 2016
1 parent ce1be46 commit 99bb62f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions backends/audiocd/linux/linux-audiocd.cpp
Expand Up @@ -62,6 +62,7 @@
#include <linux/cdrom.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/types.h>

enum {
kLeadoutTrack = 0xAA
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 99bb62f

Please sign in to comment.