summaryrefslogtreecommitdiff
path: root/libkms++/card.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libkms++/card.cpp')
-rw-r--r--libkms++/card.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/libkms++/card.cpp b/libkms++/card.cpp
index 48ab560..d5b823f 100644
--- a/libkms++/card.cpp
+++ b/libkms++/card.cpp
@@ -17,13 +17,16 @@ namespace kms
{
Card::Card()
+ : Card("/dev/dri/card0")
{
- const char *card = "/dev/dri/card0";
+}
+
- int fd = open(card, O_RDWR | O_CLOEXEC);
+Card::Card(const std::string& device)
+{
+ int fd = open(device.c_str(), O_RDWR | O_CLOEXEC);
if (fd < 0)
- throw invalid_argument(string(strerror(errno)) + " opening " +
- card);
+ throw invalid_argument(string(strerror(errno)) + " opening " + device);
m_fd = fd;
int r;