Fixed 2 fd leaks in comm functions.
Removed erroneous GetLastError() check in WaitCommEvent().
This commit is contained in:
parent
496603cf86
commit
585e9d6c24
|
@ -1567,6 +1567,7 @@ BOOL WINAPI SetCommTimeouts(
|
|||
|
||||
if (-1==tcgetattr(fd,&tios)) {
|
||||
FIXME("tcgetattr on fd %d failed!\n",fd);
|
||||
close(fd);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -1591,6 +1592,7 @@ BOOL WINAPI SetCommTimeouts(
|
|||
|
||||
if (-1==tcsetattr(fd,0,&tios)) {
|
||||
FIXME("tcsetattr on fd %d failed!\n",fd);
|
||||
close(fd);
|
||||
return FALSE;
|
||||
}
|
||||
close(fd);
|
||||
|
@ -1760,12 +1762,6 @@ BOOL WINAPI WaitCommEvent(
|
|||
|
||||
COMM_WaitCommEvent(hFile, lpdwEvents, &ov);
|
||||
|
||||
if(GetLastError()!=STATUS_PENDING)
|
||||
{
|
||||
CloseHandle(ov.hEvent);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* wait for the overlapped to complete */
|
||||
ret = GetOverlappedResult(hFile, &ov, NULL, TRUE);
|
||||
CloseHandle(ov.hEvent);
|
||||
|
|
Loading…
Reference in New Issue