aboutsummaryrefslogtreecommitdiffstats
path: root/utils/common/media-info.cpp
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2018-02-05 18:09:44 +0100
committerHans Verkuil <hans.verkuil@cisco.com>2018-02-05 18:09:44 +0100
commit9c3669241762a128cd896e8799aae210fc8b7214 (patch)
tree5a41c3c40324965b74c845ea8244fc97aacd0c95 /utils/common/media-info.cpp
parente3f326049fdcc02199d11d7988428afa78dfa143 (diff)
media-info: use .c_str for ifstream constructor
Needed for pre-C++11 compilers that do not understand std::string as constructor argument. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Reported-by: Tim Harvey <tharvey@gateworks.com>
Diffstat (limited to 'utils/common/media-info.cpp')
-rw-r--r--utils/common/media-info.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/common/media-info.cpp b/utils/common/media-info.cpp
index eef743e1..39da9b8e 100644
--- a/utils/common/media-info.cpp
+++ b/utils/common/media-info.cpp
@@ -76,7 +76,7 @@ media_type media_detect_type(const char *device)
uevent_path += num2s(major(sb.st_rdev), false) + ":" +
num2s(minor(sb.st_rdev), false) + "/uevent";
- std::ifstream uevent_file(uevent_path);
+ std::ifstream uevent_file(uevent_path.c_str());
if (uevent_file.fail())
return MEDIA_TYPE_UNKNOWN;
@@ -117,7 +117,7 @@ std::string media_get_device(__u32 major, __u32 minor)
sprintf(fmt, "%d:%d", major, minor);
uevent_path += std::string(fmt) + "/uevent";
- std::ifstream uevent_file(uevent_path);
+ std::ifstream uevent_file(uevent_path.c_str());
if (uevent_file.fail())
return "";

Privacy Policy