aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-01-07 20:24:57 +0100
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-01-07 20:24:57 +0100
commitd65e74a20a50e2161e5ff2007f53aea8e3b105e2 (patch)
tree63f3b64a1cda521e44e452199ec99ad8865360bb
parent8e624e9919040e2ec99be764394bb33a2bc77fd9 (diff)
downloadrelabsd-d65e74a20a50e2161e5ff2007f53aea8e3b105e2.zip
relabsd-d65e74a20a50e2161e5ff2007f53aea8e3b105e2.tar.bz2
...
-rw-r--r--include/relabsd/device/virtual_device_types.h13
-rw-r--r--src/device/physical/physical_device.c15
-rw-r--r--src/device/virtual/virtual_device.c2
3 files changed, 13 insertions, 17 deletions
diff --git a/include/relabsd/device/virtual_device_types.h b/include/relabsd/device/virtual_device_types.h
index 304f537..900d3d9 100644
--- a/include/relabsd/device/virtual_device_types.h
+++ b/include/relabsd/device/virtual_device_types.h
@@ -3,19 +3,6 @@
#include <libevdev/libevdev.h>
#include <libevdev/libevdev-uinput.h>
-/*
- LIBEVDEV_UINPUT_OPEN_MANAGED is not defined on my machines.
- It is not my place to define it, so I'll avoid the issue by defining my own
- constant.
-*/
-#ifndef LIBEVDEV_UINPUT_OPEN_MANAGED
- #pragma message "[WARNING] libevdev did not define " \
- "LIBEVDEV_UINPUT_OPEN_MANAGED, using value '-2' instead."
- #define RELABSD_UINPUT_OPEN_MANAGED -2
-#else
- #define RELABSD_UINPUT_OPEN_MANAGED LIBEVDEV_UINPUT_OPEN_MANAGED
-#endif
-
struct relabsd_virtual_device
{
int already_timed_out;
diff --git a/src/device/physical/physical_device.c b/src/device/physical/physical_device.c
index 24c73af..cf74b3c 100644
--- a/src/device/physical/physical_device.c
+++ b/src/device/physical/physical_device.c
@@ -12,6 +12,8 @@
#include <relabsd/config/parameters.h>
+#include <relabsd/server.h>
+
#include <relabsd/device/physical_device.h>
/******************************************************************************/
@@ -200,11 +202,18 @@ int relabsd_physical_device_read
device->is_late = 0;
return -1;
- }
- RELABSD_S_PROG_ERROR("Reached what is supposed to be dead code.");
+ default:
+ RELABSD_FATAL
+ (
+ "Unable to access the physical device: %s.",
+ strerror(-returned_code)
+ );
- return -1;
+ relabsd_server_interrupt();
+
+ return -1;
+ }
}
int relabsd_physical_device_is_late
diff --git a/src/device/virtual/virtual_device.c b/src/device/virtual/virtual_device.c
index 6866d65..bd73743 100644
--- a/src/device/virtual/virtual_device.c
+++ b/src/device/virtual/virtual_device.c
@@ -213,7 +213,7 @@ int relabsd_virtual_device_create_from
(
physical_device_libevdev,
/* See top of the file. */
- RELABSD_UINPUT_OPEN_MANAGED,
+ LIBEVDEV_UINPUT_OPEN_MANAGED,
&(device->uinput_device)
);