From 956487434d02c1911a942bed1a3949719fe54d53 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Tue, 30 Aug 2011 16:41:29 +0200 Subject: [PATCH] ntdll: Handle errno also for non ENOENT errors on lseek (Coverity). --- dlls/ntdll/directory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index 548189ca6b3..5d6d2cc1580 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -1547,9 +1547,9 @@ static int read_directory_getdents( int fd, IO_STATUS_BLOCK *io, void *buffer, U else { old_pos = lseek( fd, 0, SEEK_CUR ); - if (old_pos == -1 && errno == ENOENT) + if (old_pos == -1) { - io->u.Status = STATUS_NO_MORE_FILES; + io->u.Status = (errno == ENOENT) ? STATUS_NO_MORE_FILES : FILE_GetNtStatus(); res = 0; goto done; }