gdb: use gdb::optional instead of passing a pointer to gdb::array_view
[deliverable/binutils-gdb.git] / gdb / ser-unix.c
index df6bc4c7c4ceed57adb4fc109115030509a8bc8c..96d024eea3d956814f976b4be533c12178a26626 100644 (file)
@@ -1,6 +1,6 @@
 /* Serial interface for local (hardwired) serial ports on Un*x like systems
 
-   Copyright (C) 1992-2020 Free Software Foundation, Inc.
+   Copyright (C) 1992-2021 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #include <sys/socket.h>
 #include "gdbsupport/gdb_sys_time.h"
 
-#include "gdb_select.h"
+#include "gdbsupport/gdb_select.h"
 #include "gdbcmd.h"
 #include "gdbsupport/filestuff.h"
 #include <termios.h>
-#include "inflow.h"
+#include "gdbsupport/scoped_ignore_sigttou.h"
 
 struct hardwire_ttystate
   {
@@ -343,31 +343,31 @@ rate_to_code (int rate)
     {
       /* test for perfect macth.  */
       if (rate == baudtab[i].rate)
-        return baudtab[i].code;
+       return baudtab[i].code;
       else
-        {
+       {
          /* check if it is in between valid values.  */
-          if (rate < baudtab[i].rate)
+         if (rate < baudtab[i].rate)
            {
              if (i)
-               {
-                 warning (_("Invalid baud rate %d.  "
+               {
+                 warning (_("Invalid baud rate %d.  "
                             "Closest values are %d and %d."),
                           rate, baudtab[i - 1].rate, baudtab[i].rate);
                }
              else
-               {
-                 warning (_("Invalid baud rate %d.  Minimum value is %d."),
+               {
+                 warning (_("Invalid baud rate %d.  Minimum value is %d."),
                           rate, baudtab[0].rate);
                }
              return -1;
            }
-        }
+       }
     }
  
   /* The requested speed was too large.  */
   warning (_("Invalid baud rate %d.  Maximum value is %d."),
-            rate, baudtab[i - 1].rate);
+           rate, baudtab[i - 1].rate);
   return -1;
 }
 
@@ -380,7 +380,7 @@ hardwire_setbaudrate (struct serial *scb, int rate)
   if (baud_code < 0)
     {
       /* The baud rate was not valid.
-         A warning has already been issued.  */
+        A warning has already been issued.  */
       errno = EINVAL;
       return -1;
     }
@@ -498,8 +498,9 @@ static const struct serial_ops hardwire_ops =
   ser_unix_write_prim
 };
 
+void _initialize_ser_hardwire ();
 void
-_initialize_ser_hardwire (void)
+_initialize_ser_hardwire ()
 {
   serial_add_interface (&hardwire_ops);
 
This page took 0.024988 seconds and 4 git commands to generate.