OSDN Git Service

Unbreak 'target async'.
authorVladimir Prus <vladimir@codesourcery.com>
Sat, 23 Feb 2008 20:04:20 +0000 (20:04 +0000)
committerVladimir Prus <vladimir@codesourcery.com>
Sat, 23 Feb 2008 20:04:20 +0000 (20:04 +0000)
        * serial.c (serial_async): Set the
        handler function before enabling async
        mode.

gdb/ChangeLog
gdb/serial.c

index 05896be..1af5761 100644 (file)
@@ -1,3 +1,10 @@
+2008-02-23  Vladimir Prus  <vladimir@codesourcery.com>
+
+       Unbreak 'target async'.
+        * serial.c (serial_async): Set the
+        handler function before enabling async
+        mode.
+
 2008-02-22  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * solib-svr4.c (enable_break): Convert r_brk to a code address.
index 7bdf170..1fb7f31 100644 (file)
@@ -515,12 +515,12 @@ serial_async (struct serial *scb,
              serial_event_ftype *handler,
              void *context)
 {
-  /* Only change mode if there is a need. */
-  if ((scb->async_handler == NULL)
-      != (handler == NULL))
-    scb->ops->async (scb, handler != NULL);
+  int changed = ((scb->async_handler == NULL) != (handler == NULL));
   scb->async_handler = handler;
   scb->async_context = context;
+  /* Only change mode if there is a need.  */
+  if (changed)
+    scb->ops->async (scb, handler != NULL);
 }
 
 int