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
This commit is contained in:
Tom Tromey
2023-09-01 11:04:58 -06:00
parent c618a1c548
commit 4dda9cc4b0

View File

@@ -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;