summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2018-03-08 11:01:10 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2018-03-09 15:08:42 +1000
commit3b20f3d02b6e1d6f42420700361aebf676ba00d5 (patch)
tree0a6492e0cce88cfe385b5f4c49f2c18afeb9f378 /tools
parent7dc52459b344fb9393e86fe51c77cab77dc22460 (diff)
tools: libinput-record: add separate variable for the first device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'tools')
-rw-r--r--tools/libinput-record.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/libinput-record.c b/tools/libinput-record.c
index 36a0a6d1..97d817a0 100644
--- a/tools/libinput-record.c
+++ b/tools/libinput-record.c
@@ -764,6 +764,7 @@ mainloop(struct record_context *ctx)
bool autorestart = (ctx->timeout > 0);
struct pollfd fds[ctx->ndevices + 1];
struct record_device *d = NULL;
+ struct record_device *first_device = NULL;
struct timespec ts;
sigset_t mask;
int idx;
@@ -821,8 +822,10 @@ mainloop(struct record_context *ctx)
/* we only print the first device's description, the
* rest is assembled after CTRL+C */
- d = list_first_entry(&ctx->devices, d, link);
- print_device_description(ctx, d);
+ first_device = list_first_entry(&ctx->devices,
+ first_device,
+ link);
+ print_device_description(ctx, first_device);
iprintf(ctx, "events:\n");
indent_push(ctx);