Fix error checking on CreateFile() usage

This commit is contained in:
James Buren 2024-07-28 05:30:14 +00:00 committed by Adam Honse
parent e2126b9d29
commit 5dc31a81a0

View file

@ -108,7 +108,7 @@ bool serial_port::serial_open()
\*-----------------------------------------*/
file_descriptor = CreateFile(full_path, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
if((int)file_descriptor < 0)
if(file_descriptor == INVALID_HANDLE_VALUE)
{
return false;
}