Fix error checking on CreateFile() usage
This commit is contained in:
parent
e2126b9d29
commit
5dc31a81a0
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue