Andrew Geissler | 8f84068 | 2023-07-21 09:09:43 -0500 | [diff] [blame] | 1 | From 9b96fcfa5748934b8b6a4db4ee25a5e3165905c0 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Sat, 1 Jul 2023 07:48:17 -0700 |
| 4 | Subject: [PATCH] examples: Replace use of termio.h with termios.h |
| 5 | |
| 6 | Fixes build with musl and makes it portable |
| 7 | |
| 8 | Upstream-Status: Backport [https://github.com/linux-pam/linux-pam/commit/5374f677e4cae669eb9accf2449178b602e8a40a] |
| 9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 10 | --- |
| 11 | examples/tty_conv.c | 5 +++-- |
| 12 | 1 file changed, 3 insertions(+), 2 deletions(-) |
| 13 | |
| 14 | diff --git a/examples/tty_conv.c b/examples/tty_conv.c |
| 15 | index 23f0684..db22500 100644 |
| 16 | --- a/examples/tty_conv.c |
| 17 | +++ b/examples/tty_conv.c |
| 18 | @@ -6,7 +6,8 @@ |
| 19 | #include <string.h> |
| 20 | #include <errno.h> |
| 21 | #include <unistd.h> |
| 22 | -#include <termio.h> |
| 23 | +#include <termios.h> |
| 24 | +#include <sys/ioctl.h> |
| 25 | #include <security/pam_appl.h> |
| 26 | |
| 27 | /*************************************** |
| 28 | @@ -16,7 +17,7 @@ |
| 29 | ***************************************/ |
| 30 | static void echoOff(int fd, int off) |
| 31 | { |
| 32 | - struct termio tty; |
| 33 | + struct termios tty; |
| 34 | if (ioctl(fd, TCGETA, &tty) < 0) |
| 35 | { |
| 36 | fprintf(stderr, "TCGETA failed: %s\n", strerror(errno)); |
| 37 | -- |
| 38 | 2.41.0 |
| 39 | |