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.

38 lines
1.1 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. --- a/evtest.c
  13. +++ b/evtest.c
  14. @@ -61,6 +61,11 @@
  15. #include <unistd.h>
  16. #include <limits.h> /* PATH_MAX */
  17. +#ifndef input_event_sec
  18. +#define input_event_sec time.tv_sec
  19. +#define input_event_usec time.tv_usec
  20. +#endif
  21. +
  22. #define BITS_PER_LONG (sizeof(long) * 8)
  23. #define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1)
  24. #define OFF(x) ((x)%BITS_PER_LONG)
  25. @@ -1140,7 +1145,7 @@ static int print_events(int fd)
  26. type = ev[i].type;
  27. code = ev[i].code;
  28. - printf("Event: time %ld.%06ld, ", ev[i].time.tv_sec, ev[i].time.tv_usec);
  29. + printf("Event: time %ld.%06ld, ", ev[i].input_event_sec, ev[i].input_event_usec);
  30. if (type == EV_SYN) {
  31. if (code == SYN_MT_REPORT)