ntdll: Return an error from CDROM_Open if fstat fails.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Alex Henrie 2015-12-29 22:37:59 -07:00 committed by Alexandre Julliard
parent 48f3bacb0b
commit fab5ee65b6
1 changed files with 2 additions and 2 deletions

View File

@ -667,7 +667,7 @@ static NTSTATUS CDROM_Open(int fd, int* dev)
NTSTATUS ret = STATUS_SUCCESS;
int empty = -1;
fstat(fd, &st);
if (fstat(fd, &st) == -1) return FILE_GetNtStatus();
RtlEnterCriticalSection( &cache_section );
for (*dev = 0; *dev < MAX_CACHE_ENTRIES; (*dev)++)
@ -2834,7 +2834,7 @@ NTSTATUS CDROM_DeviceIoControl(HANDLE hDevice,
{
DWORD sz = 0;
NTSTATUS status = STATUS_SUCCESS;
int fd, needs_close, dev;
int fd, needs_close, dev = 0;
TRACE("%p %s %p %d %p %d %p\n",
hDevice, iocodex(dwIoControlCode), lpInBuffer, nInBufferSize,