diff --git a/src/cryfs_lib/CryOpenDir.cpp b/src/cryfs_lib/CryOpenDir.cpp index 3b7faf62..49650279 100644 --- a/src/cryfs_lib/CryOpenDir.cpp +++ b/src/cryfs_lib/CryOpenDir.cpp @@ -24,6 +24,8 @@ CryOpenDir::~CryOpenDir() { unique_ptr> CryOpenDir::readdir() const { ::rewinddir(_dir); + // Set errno=0 so we can detect whether it changed later + errno = 0; auto result = make_unique>();