kernel32: Check for the correct error return value from open.

This commit is contained in:
Robert Shearman 2006-01-05 12:18:29 +01:00 committed by Alexandre Julliard
parent 089435d43b
commit 1191249fc9
1 changed files with 2 additions and 3 deletions

View File

@ -161,12 +161,11 @@ static void create_scsi_entry( PSCSI_ADDRESS scsi_addr, LPSTR lpDriver, UINT uDr
int fd, dma;
fd = open(lpUnixDeviceName, O_RDONLY|O_NONBLOCK);
if (fd)
if (fd != -1)
{
if (ioctl(fd, HDIO_GET_DMA, &dma) != -1) value = dma;
close(fd);
}else
ERR("Can't open %s", buffer);
}
#endif
RtlCreateUnicodeStringFromAsciiz( &nameW, "DMAEnabled" );
NtSetValueKey( portKey,&nameW, 0, REG_DWORD, (BYTE *)&value, sizeof(DWORD));