[PATCH evemu 2/7] Change evemu_destroy to take a struct evemu_device
Peter Hutterer
peter.hutterer at who-t.net
Thu Nov 21 16:19:57 PST 2013
We need the struct around for future operations on it, e.g. freeing memory
associated with the uinput device.
This is an API and ABI break, already covered by the soname bump from the
previous commit.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
python/evemu/__init__.py | 2 +-
src/evemu.c | 2 +-
src/evemu.h | 2 +-
tools/evemu-device.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/python/evemu/__init__.py b/python/evemu/__init__.py
index abdbf7e..5d7f672 100644
--- a/python/evemu/__init__.py
+++ b/python/evemu/__init__.py
@@ -79,7 +79,7 @@ class Device(object):
if hasattr(self, "_is_propfile") and self._is_propfile:
self._file.close()
self._evemu._call(self._evemu.get_lib().evemu_destroy,
- self._uinput)
+ self._evemu_device, self._uinput)
def _create_devnode(self):
self._evemu._call(self._evemu.get_lib().evemu_create,
diff --git a/src/evemu.c b/src/evemu.c
index 15040a9..67b7645 100644
--- a/src/evemu.c
+++ b/src/evemu.c
@@ -932,7 +932,7 @@ int evemu_create(struct evemu_device *dev, int fd)
return ret;
}
-void evemu_destroy(int fd)
+void evemu_destroy(struct evemu_device *dev, int fd)
{
int ret;
SYSCALL(ret = ioctl(fd, UI_DEV_DESTROY, NULL));
diff --git a/src/evemu.h b/src/evemu.h
index 4ea4307..e46000d 100644
--- a/src/evemu.h
+++ b/src/evemu.h
@@ -426,7 +426,7 @@ int evemu_create(struct evemu_device *dev, int fd);
*
* Destroys all devices created using this file descriptor.
*/
-void evemu_destroy(int fd);
+void evemu_destroy(struct evemu_device *dev, int fd);
#ifdef __cplusplus
}
diff --git a/tools/evemu-device.c b/tools/evemu-device.c
index 5ddd166..768dd3d 100644
--- a/tools/evemu-device.c
+++ b/tools/evemu-device.c
@@ -225,7 +225,7 @@ static int evemu_device(FILE *fp)
if (ret < 0)
goto out_close;
hold_device(dev);
- evemu_destroy(fd);
+ evemu_destroy(dev, fd);
out_close:
close(fd);
--
1.8.3.1
More information about the Input-tools
mailing list