*** empty log message ***
[binutils-gdb.git] / gdb / ser-unix.c
index 3a24ac1895c96de3fbe95a816884f9e8155eee2b..266453c2c1e99979da320c97791ab2b453000685 100644 (file)
@@ -1,13 +1,13 @@
 /* Serial interface for local (hardwired) serial ports on Un*x like systems
 
    Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2003,
-   2004, 2005, 2007 Free Software Foundation, Inc.
+   2004, 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -16,9 +16,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
 #include "serial.h"
@@ -308,6 +306,7 @@ hardwire_drain_output (struct serial *scb)
      to be discarded. */
   {
     struct hardwire_ttystate state;
+
     if (get_tty_state (scb, &state))
       {
        return (-1);
@@ -370,16 +369,13 @@ hardwire_send_break (struct serial *scb)
 #ifdef HAVE_SGTTY
   {
     int status;
-    struct timeval timeout;
 
     status = ioctl (scb->fd, TIOCSBRK, 0);
 
     /* Can't use usleep; it doesn't exist in BSD 4.2.  */
-    /* Note that if this select() is interrupted by a signal it will not wait
-       the full length of time.  I think that is OK.  */
-    timeout.tv_sec = 0;
-    timeout.tv_usec = 250000;
-    gdb_select (0, 0, 0, 0, &timeout);
+    /* Note that if this gdb_select() is interrupted by a signal it will not
+       wait the full length of time.  I think that is OK.  */
+    gdb_usleep (250000);
     status = ioctl (scb->fd, TIOCCBRK, 0);
     return status;
   }
@@ -893,6 +889,7 @@ void
 _initialize_ser_hardwire (void)
 {
   struct serial_ops *ops = XMALLOC (struct serial_ops);
+
   memset (ops, 0, sizeof (struct serial_ops));
   ops->name = "hardwire";
   ops->next = 0;