Avoid serial port write error for Windows,

This commit is contained in:
wb2osz 2021-09-21 13:29:29 -04:00
parent 3220931439
commit 023f675caa
1 changed files with 3 additions and 8 deletions

View File

@ -304,17 +304,12 @@ int serial_port_write (MYFDTYPE fd, char *str, int len)
{ {
text_color_set(DW_COLOR_ERROR); text_color_set(DW_COLOR_ERROR);
dw_printf ("Error writing to serial port. Error %d.\n\n", err); dw_printf ("Error writing to serial port. Error %d.\n\n", err);
return (-1);
} }
} }
else if ((int)nwritten != len)
{
// Do we want this message here?
// Or rely on caller to check and provide something more meaningful for the usage?
//text_color_set(DW_COLOR_ERROR);
//dw_printf ("Error writing to serial port. Only %d of %d written.\n\n", (int)nwritten, len);
}
return (nwritten); // nwritten is 0 for asynchronous write, at this point, so just return the requested len.
return (len);
#else #else
int written; int written;