0001-linux-serial-test.c-fix-missing-CMSPAR-define-on-MIP.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. From c34767aa22623a21369f1464c52fc4635895223c Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Fri, 8 Nov 2019 18:25:35 +0100
  4. Subject: [PATCH] linux-serial-test.c: fix missing CMSPAR define on MIPS
  5. This patch is an adaptation of
  6. https://git.busybox.net/buildroot/diff/package/freerdp/0003-add-missing-define.patch?id=78cd32631e959e04b1a2f18be7b0757e21482438
  7. linux-serial-test.c uses CMSPAR, which is defined by glibc in
  8. bits/termios.h.
  9. glibc has two flavours of bits/termios.h: a generic one and an
  10. architecture-specific one. When installing, glibc will install the
  11. architecture-specific file if it exists, otherwise it installs the
  12. generic file. Only Alpha, MIPS, PPC and Sparc have their own
  13. bits/termios.h.
  14. The generic bits/termios.h, as well as the Alpha, PPC and Sparc flavours
  15. do define CMSPAR. However, the MIPS flavour does not define it.
  16. Define CMSPAR to the value from the generic value, which is also the
  17. value known to the Linux kernel for MIPS.
  18. Fixes:
  19. - http://autobuild.buildroot.org/results/1350cc46dcb285772b1a4c90aec6ba38fdb11e3c
  20. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  21. [Upstream status: https://github.com/cbrake/linux-serial-test/pull/20]
  22. ---
  23. linux-serial-test.c | 8 ++++++++
  24. 1 file changed, 8 insertions(+)
  25. diff --git a/linux-serial-test.c b/linux-serial-test.c
  26. index 5e7504e..0d4a919 100644
  27. --- a/linux-serial-test.c
  28. +++ b/linux-serial-test.c
  29. @@ -17,6 +17,14 @@
  30. #include <linux/serial.h>
  31. #include <errno.h>
  32. +/*
  33. + * glibc for MIPS has its own bits/termios.h which does not define
  34. + * CMSPAR, so we vampirise the value from the generic bits/termios.h
  35. + */
  36. +#ifndef CMSPAR
  37. +#define CMSPAR 010000000000
  38. +#endif
  39. +
  40. // command line args
  41. int _cl_baud = 0;
  42. char *_cl_port = NULL;
  43. --
  44. 2.23.0