From 661354e6cf4e19c9ca7210fbf49ce293e53418d1 Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Wed, 26 Dec 2012 17:23:35 +0100 Subject: use dev_t for comparing devices --- inputdev.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'inputdev.c') diff --git a/inputdev.c b/inputdev.c index f800425..4802305 100644 --- a/inputdev.c +++ b/inputdev.c @@ -57,6 +57,10 @@ public: return this->dev_t_ - b.dev_t_; } + virtual int Compare(dev_t b) const { + return this->dev_t_ - b; + } + void handle(void); bool open(void); bool start(int efd); @@ -532,8 +536,12 @@ void cInputDeviceController::Action(void) void cInputDeviceController::remove_device(char const *dev_path) { class cInputDevice *dev = NULL; + struct stat st; - { + if (stat(dev_path, &st) < 0) { + esyslog("%s: fstat(%s) failed: %s\n", plugin_name(), + dev_path, strerror(errno)); + } else { cMutexLock lock(&dev_mutex_); cInputDevice *i; -- cgit v1.2.3