Thread (18 messages) 18 messages, 2 authors, 2021-09-13
STALE1751d
Revisions (3)
  1. v1 [diff vs current]
  2. v1 [diff vs current]
  3. v1 current

[PATCH 05/15] ioctl_tty.2: Minor tweaks to Pali's patch

From: Alejandro Colomar <hidden>
Date: 2021-09-10 22:47:28
Subsystem: the rest · Maintainer: Linus Torvalds

Cc: Pali Rohár <pali@kernel.org>
Signed-off-by: Alejandro Colomar <redacted>
---
 man2/ioctl_tty.2 | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/man2/ioctl_tty.2 b/man2/ioctl_tty.2
index fd1f3dc25..d0a10a508 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);
-- 
2.33.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help