aboutsummaryrefslogtreecommitdiff
path: root/gdb/serial.c
diff options
context:
space:
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