Revert "- rc_input: rename checkLnkDev() to checkdev_lnk(); ..."

This reverts commit a0481953d0.


Origin commit data
------------------
Branch: ni/coolstream
Commit: 63dce04974
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2017-02-22 (Wed, 22 Feb 2017)



------------------
This commit was generated by Migit
This commit is contained in:
Stefan Seyfried
2017-02-22 20:05:26 +01:00
parent 4d2bb004c9
commit 0458fd217f
2 changed files with 22 additions and 21 deletions

View File

@@ -174,25 +174,6 @@ bool CRCInput::checkdev()
return true; /* need to check anyway... */
}
#ifdef BOXMODEL_CS_HD2
bool CRCInput::checkdev_lnk(std::string lnk)
{
static struct stat info;
if (lstat(lnk.c_str(), &info) != -1) {
if (S_ISLNK(info.st_mode)) {
std::string tmp = readLink(lnk);
if (!tmp.empty()) {
if (lstat(tmp.c_str(), &info) != -1) {
if (S_ISCHR(info.st_mode))
return true;
}
}
}
}
return false;
}
#endif
bool CRCInput::checkpath(in_dev id)
{
for (std::vector<in_dev>::iterator it = indev.begin(); it != indev.end(); ++it) {
@@ -225,6 +206,25 @@ bool CRCInput::checkpath(in_dev id)
return false;
}
#ifdef BOXMODEL_CS_HD2
bool CRCInput::checkLnkDev(std::string lnk)
{
static struct stat info;
if (lstat(lnk.c_str(), &info) != -1) {
if (S_ISLNK(info.st_mode)) {
std::string tmp = readLink(lnk);
if (!tmp.empty()) {
if (lstat(tmp.c_str(), &info) != -1) {
if (S_ISCHR(info.st_mode))
return true;
}
}
}
}
return false;
}
#endif
/* if recheck == true, only not already opened devices are opened, if not, close then (re)open all */
void CRCInput::open(bool recheck)
{
@@ -249,12 +249,13 @@ void CRCInput::open(bool recheck)
#ifdef BOXMODEL_CS_HD2
&& (dentry->d_type != DT_LNK)
#endif
) {
d_printf("[rcinput:%s] skipping '%s'\n", __func__, dentry->d_name);
continue;
}
#ifdef BOXMODEL_CS_HD2
if ((dentry->d_type == DT_LNK) && (!checkdev_lnk("/dev/input/" + std::string(dentry->d_name)))) {
if ((dentry->d_type == DT_LNK) && (!checkLnkDev("/dev/input/" + std::string(dentry->d_name)))) {
d_printf("[rcinput:%s] skipping '%s'\n", __func__, dentry->d_name);
continue;
}

View File

@@ -171,7 +171,7 @@ class CRCInput
bool checkpath(in_dev id);
bool checkdev();
#ifdef BOXMODEL_CS_HD2
bool checkdev_lnk(std::string lnk);
bool checkLnkDev(std::string lnk);
#endif
void close();
int translate(int code);