From 75c10de291a042a516805dc46a36b3d7f2890b0e Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Mon, 27 May 2013 01:05:58 +0200 Subject: [PATCH] libroot_build _kern_read_dir(): reset errno before readdir() Since we're checking errno when readdir() didn't return an entry, we need to reset it before, or we might see a spurious error value. --- src/build/libroot/fs.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/build/libroot/fs.cpp b/src/build/libroot/fs.cpp index c298454647..5a9ebdfb09 100644 --- a/src/build/libroot/fs.cpp +++ b/src/build/libroot/fs.cpp @@ -609,6 +609,7 @@ _kern_read_dir(int fd, struct dirent *buffer, size_t bufferSize, // get the next entry dirent *entry; + errno = 0; if (dynamic_cast(descriptor)) entry = fs_read_attr_dir(descriptor->dir); else