From 3b20f3d02b6e1d6f42420700361aebf676ba00d5 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 8 Mar 2018 11:01:10 +1000 Subject: [PATCH] tools: libinput-record: add separate variable for the first device Signed-off-by: Peter Hutterer --- tools/libinput-record.c | 7 +++++-- 1 file 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);