You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.2 KiB

  1. From 648f5c1a9e07843e185782d207bc1bcbe6586f6e Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <raj.khem@gmail.com>
  3. Date: Sat, 30 Nov 2019 11:58:58 -0800
  4. Subject: [PATCH] Fix build on 32bit arches with 64bit time_t
  5. time element is deprecated on new input_event structure in kernel's
  6. input.h [1]
  7. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=152194fe9c3f
  8. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  9. ---
  10. evtest.c | 7 ++++++-
  11. 1 file changed, 6 insertions(+), 1 deletion(-)
  12. diff --git a/evtest.c b/evtest.c
  13. index be5e42c..d00437f 100644
  14. --- a/evtest.c
  15. +++ b/evtest.c
  16. @@ -62,6 +62,11 @@
  17. #include <unistd.h>
  18. #include <limits.h> /* PATH_MAX */
  19. +#ifndef input_event_sec
  20. +#define input_event_sec time.tv_sec
  21. +#define input_event_usec time.tv_usec
  22. +#endif
  23. +
  24. #define BITS_PER_LONG (sizeof(long) * 8)
  25. #define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1)
  26. #define OFF(x) ((x)%BITS_PER_LONG)
  27. @@ -1141,7 +1146,7 @@ static int print_events(int fd)
  28. type = ev[i].type;
  29. code = ev[i].code;
  30. - printf("Event: time %ld.%06ld, ", ev[i].time.tv_sec, ev[i].time.tv_usec);
  31. + printf("Event: time %ld.%06ld, ", ev[i].input_event_sec, ev[i].input_event_usec);
  32. if (type == EV_SYN) {
  33. if (code == SYN_MT_REPORT)
  34. --
  35. 2.25.1