mirror of
https://agent.ghink.cloud/wb2osz/direwolf
synced 2025-04-11 09:08:34 +00:00
Avoid serial port write error for Windows,
This commit is contained in:
parent
3220931439
commit
023f675caa
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user