aboutsummaryrefslogtreecommitdiff
path: root/gdb/serial.c
diff options
context:
space:
mode:
authorVladimir Prus <vladimir@codesourcery.com>2008-02-23 20:04:20 +0000
committerVladimir Prus <vladimir@codesourcery.com>2008-02-23 20:04:20 +0000
commit05ce04a4238ed7716316d221ff2b58bed336ca79 (patch)
tree5cb754a60318f525c985bb20dce9712300d11c51 /gdb/serial.c
parent849830bdfb30c93fda1fd4098b7070e8159d3663 (diff)
downloadgdb-05ce04a4238ed7716316d221ff2b58bed336ca79.zip
gdb-05ce04a4238ed7716316d221ff2b58bed336ca79.tar.gz
gdb-05ce04a4238ed7716316d221ff2b58bed336ca79.tar.bz2
Unbreak 'target async'.
* serial.c (serial_async): Set the handler function before enabling async mode.
Diffstat (limited to 'gdb/serial.c')
-rw-r--r--gdb/serial.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/serial.c b/gdb/serial.c
index 7bdf170..1fb7f31 100644
--- a/gdb/serial.c
+++ b/gdb/serial.c
@@ -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