From ee9138f065391914dddf158ca9676fb9d87b9667 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Wed, 22 Feb 2017 08:45:37 +0100 Subject: [PATCH] Revert "rcinput: Add exception handling for cs hd2" This reverts commit 1b79faff780befa63a04be86560e7183d7a663aa. Wrong in so many ways :-) - The code worked perfectly. But ok, it's easier possible. ;) Signed-off-by: M. Liebmann --- src/driver/rcinput.cpp | 53 +----------------------------------------- src/driver/rcinput.h | 6 ----- 2 files changed, 1 insertion(+), 58 deletions(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 8357f2355..ddba969d2 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -174,49 +174,9 @@ 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::iterator it = indev.begin(); it != indev.end(); ++it) { -#ifdef BOXMODEL_CS_HD2 - if ((id.type == DT_LNK) || ((*it).type == DT_LNK)) { - std::string check1, check2; - if (id.type == DT_LNK) - check1 = readLink(id.path); - else - check1 = id.path; - - if ((*it).type == DT_LNK) - check2 = readLink((*it).path); - else - check2 = (*it).path; - - if ((!check1.empty()) && (!check2.empty()) && (check1 == check2)) { - printf("[rcinput:%s] skipping already opened %s => %s\n", __func__, id.path.c_str(), check1.c_str()); - return true; - } - else - return false; - } -#endif if ((*it).path == id.path) { printf("[rcinput:%s] skipping already opened %s\n", __func__, id.path.c_str()); return true; @@ -245,21 +205,10 @@ void CRCInput::open(bool recheck) while ((dentry = readdir(dir)) != NULL) { - if ((dentry->d_type != DT_CHR) -#ifdef BOXMODEL_CS_HD2 - && (dentry->d_type != DT_LNK) -#endif - ) { + if (dentry->d_type != DT_CHR) { 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)))) { - d_printf("[rcinput:%s] skipping '%s'\n", __func__, dentry->d_name); - continue; - } - id.type = dentry->d_type; -#endif d_printf("[rcinput:%s] considering '%s'\n", __func__, dentry->d_name); id.path = "/dev/input/" + std::string(dentry->d_name); if (checkpath(id)) diff --git a/src/driver/rcinput.h b/src/driver/rcinput.h index 450dd4dd7..d2c29e50f 100644 --- a/src/driver/rcinput.h +++ b/src/driver/rcinput.h @@ -145,9 +145,6 @@ class CRCInput { int fd; std::string path; -#ifdef BOXMODEL_CS_HD2 - int type; -#endif }; uint32_t timerid; @@ -170,9 +167,6 @@ class CRCInput void open(bool recheck = false); bool checkpath(in_dev id); bool checkdev(); -#ifdef BOXMODEL_CS_HD2 - bool checkdev_lnk(std::string lnk); -#endif void close(); int translate(int code); void calculateMaxFd(void);