2010-05-05 Michael Snyder <msnyder@vmware.com>
[deliverable/binutils-gdb.git] / gdb / ser-base.c
index 8fdfd254611dcf062b01540402a35371288ad38e..6d4544130d5abf2105449bd10179ae8fa7d3c38b 100644 (file)
@@ -1,7 +1,7 @@
 /* Generic serial interface functions.
 
    Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2003,
-   2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+   2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -63,7 +63,7 @@ enum {
    the need to make redundant calls into the event-loop - the next
    scheduled task is only changed when needed. */
 
-void
+static void
 reschedule (struct serial *scb)
 {
   if (serial_is_async_p (scb))
@@ -363,6 +363,13 @@ generic_readchar (struct serial *scb, int timeout,
          s = read (scb->error_fd, &buf, to_read);
          if (s == -1)
            break;
+         if (s == 0)
+           {
+             /* EOF */
+             close (scb->error_fd);
+             scb->error_fd = -1;
+             break;
+           }
 
          /* In theory, embedded newlines are not a problem.
             But for MI, we want each output line to have just
This page took 0.025842 seconds and 4 git commands to generate.