diff options
| author | Alejandro Colomar <alx.manpages@gmail.com> | 2021-09-10 15:39:25 +0200 |
|---|---|---|
| committer | Alejandro Colomar <alx.manpages@gmail.com> | 2021-09-10 15:39:25 +0200 |
| commit | f0a0bcc6a40d17d015c813fca153d66a7f7a5d5b (patch) | |
| tree | 91fe4ca6d40c358bceb558b63517db08c04bfd3b /man2 | |
| parent | f528e587fb36af312152e524513df828612c4095 (diff) | |
| download | man-pages-f0a0bcc6a40d17d015c813fca153d66a7f7a5d5b.tar.gz | |
ioctl_tty.2: Minor tweaks to Pali's patch
Cc: Pali Rohár <pali@kernel.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Diffstat (limited to 'man2')
| -rw-r--r-- | man2/ioctl_tty.2 | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/man2/ioctl_tty.2 b/man2/ioctl_tty.2 index fd1f3dc259..d0a10a5082 100644 --- a/man2/ioctl_tty.2 +++ b/man2/ioctl_tty.2 @@ -772,17 +772,17 @@ Get or set arbitrary baudrate on the serial port. int main(int argc, char *argv[]) { -#ifndef BOTHER +#if !defined BOTHER fprintf(stderr, "BOTHER is unsupported\en"); /* Program may fallback to TCGETS/TCSETS with Bnnn constants */ exit(EXIT_FAILURE); #else /* Declare tio structure, its type depends on supported ioctl */ -#ifdef TCGETS2 +# if defined TCGETS2 struct termios2 tio; -#else +# else struct termios tio; -#endif +# endif int fd, rc; if (argc != 2 && argc != 3 && argc != 4) { @@ -797,11 +797,11 @@ main(int argc, char *argv[]) } /* Get the current serial port settings via supported ioctl */ -#ifdef TCGETS2 +# if defined TCGETS2 rc = ioctl(fd, TCGETS2, &tio); -#else +# else rc = ioctl(fd, TCGETS, &tio); -#endif +# endif if (rc) { perror("TCGETS"); close(fd); @@ -822,11 +822,11 @@ main(int argc, char *argv[]) tio.c_ispeed = (argc == 4) ? atoi(argv[3]) : atoi(argv[2]); /* Set new serial port settings via supported ioctl */ -#ifdef TCSETS2 +# if defined TCSETS2 rc = ioctl(fd, TCSETS2, &tio); -#else +# else rc = ioctl(fd, TCSETS, &tio); -#endif +# endif if (rc) { perror("TCSETS"); close(fd); @@ -834,11 +834,11 @@ main(int argc, char *argv[]) } /* And get new values which were really configured */ -#ifdef TCGETS2 +# if defined TCGETS2 rc = ioctl(fd, TCGETS2, &tio); -#else +# else rc = ioctl(fd, TCGETS, &tio); -#endif +# endif if (rc) { perror("TCGETS"); close(fd); |
