diff options
author | Tom Tromey <tromey@adacore.com> | 2023-09-01 11:04:58 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2023-11-27 12:55:14 -0700 |
commit | 4dda9cc4b03788d1cf0416b39a3ab3780caf27fd (patch) | |
tree | fb451490273515f22bd1f2f2ec85d82493124fd5 | |
parent | c618a1c548193d2a6a8c3d909a3d1c620a156b5d (diff) | |
download | gdb-4dda9cc4b03788d1cf0416b39a3ab3780caf27fd.zip gdb-4dda9cc4b03788d1cf0416b39a3ab3780caf27fd.tar.gz gdb-4dda9cc4b03788d1cf0416b39a3ab3780caf27fd.tar.bz2 |
Fix latent bug in ser_windows_send_break
The ClearCommBreak documentation says:
If the function fails, the return value is zero.
ser_windows_send_break inverts this check. This has never been
noticed because the caller doesn't check the result.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30770
-rw-r--r-- | gdb/ser-mingw.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/ser-mingw.c b/gdb/ser-mingw.c index c0aa5d8..806f399 100644 --- a/gdb/ser-mingw.c +++ b/gdb/ser-mingw.c @@ -137,7 +137,7 @@ ser_windows_send_break (struct serial *scb) /* Delay for 250 milliseconds. */ Sleep (250); - if (ClearCommBreak (h)) + if (ClearCommBreak (h) == 0) return -1; return 0; |