projects
/
platform
/
core
/
api
/
usb-host.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
65257d8
)
Fix device's minor and major reading from stat
author
Jan Cybulski
<j.cybulski@samsung.com>
Thu, 9 Jul 2015 14:33:03 +0000
(16:33 +0200)
committer
Jan Cybulski
<j.cybulski@samsung.com>
Thu, 9 Jul 2015 14:36:11 +0000
(16:36 +0200)
USB device files are special files.
st_rdev field is used for obtaining special files' minor and major,
not st_dev as it was done in the code so far.
Change-Id: Ieac5b984549cc1bb81011348ee762042583230ac
Signed-off-by: Jan Cybulski <j.cybulski@samsung.com>
USD/src/common/usb-access-map.cpp
patch
|
blob
|
history
diff --git
a/USD/src/common/usb-access-map.cpp
b/USD/src/common/usb-access-map.cpp
index 17e112fa2d82d3e2d40559602e960287bed08e35..586141385986e3120ea88e49f146a497b671d2a9 100644
(file)
--- a/
USD/src/common/usb-access-map.cpp
+++ b/
USD/src/common/usb-access-map.cpp
@@
-110,12
+110,12
@@
void USBDevicePath::initFromDev(const std::string &path)
throw USD_API_ERROR_FILE_READ_FAILED;
if (!S_ISCHR(dev_st.st_mode) ||
- major(dev_st.st_dev) != USB_DEVICE_MAJOR)
+ major(dev_st.st_
r
dev) != USB_DEVICE_MAJOR)
throw USD_API_ERROR_ACCESS_DENIED;
- m_dev = dev_st.st_dev;
+ m_dev = dev_st.st_
r
dev;
ret = snprintf(buf, sizeof(buf),
- "/sys/dev/chr/%d:%d", major(m_dev), minor(m_dev));
+ "/sys/dev/ch
a
r/%d:%d", major(m_dev), minor(m_dev));
/*
* If this happened we have really big troubles,
* probably it end of the world