summaryrefslogtreecommitdiff
path: root/tools/libinput-record.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2019-07-24 13:33:11 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2019-07-24 14:57:56 +1000
commit9c2ac8f9eed71bb61a7b72da5d3582d5016577e6 (patch)
tree7235fda189a115300fd80bcefb7c04dc5e1a13b8 /tools/libinput-record.c
parentb436585b5e49c3d592f6d5a90a1ecc1056fe6ec0 (diff)
downloadlibinput-9c2ac8f9eed71bb61a7b72da5d3582d5016577e6.tar.gz
tools: record: when running from the builddir, load the quirks correctly
Fixes #324 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'tools/libinput-record.c')
-rw-r--r--tools/libinput-record.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/libinput-record.c b/tools/libinput-record.c
index 049c84f0..ff4a12f4 100644
--- a/tools/libinput-record.c
+++ b/tools/libinput-record.c
@@ -45,6 +45,7 @@
#include "libinput-version.h"
#include "libinput-git-version.h"
#include "shared.h"
+#include "builddir.h"
static const int FILE_VERSION_NUMBER = 1;
@@ -1735,10 +1736,17 @@ print_device_quirks(struct record_context *ctx, struct record_device *dev)
struct quirks_context *quirks;
const char *data_path = LIBINPUT_QUIRKS_DIR;
const char *override_file = LIBINPUT_QUIRKS_OVERRIDE_FILE;
+ const char *builddir = NULL;
if (stat(dev->devnode, &st) < 0)
return;
+ if ((builddir = builddir_lookup())) {
+ setenv("LIBINPUT_QUIRKS_DIR", LIBINPUT_QUIRKS_SRCDIR, 0);
+ data_path = LIBINPUT_QUIRKS_SRCDIR;
+ override_file = NULL;
+ }
+
quirks = quirks_init_subsystem(data_path,
override_file,
quirks_log_handler,