diff --git a/CHANGES b/CHANGES index 456a19c53..56136af74 100644 --- a/CHANGES +++ b/CHANGES @@ -27,6 +27,7 @@ * Lwt.pick and Lwt.choose select preferentially failed promises as per documentation (#856, #874, Raman Varabets) * Use the WSA_FLAG_NO_HANDLE_INHERIT on Windows when creating sockets with WSASocket if the cloexec (non-inheritable) parameter is true. Fixes a Windows problem where a child process would inherit a supposedly non-inheritable socket. (#910, Antonin Décimo) * Fix macOS/arm64 tests which have a 16k page. (#932, Kate Deplaix) + * Fix Lwt_unix.closedir incorrectly checking the return value of closedir(3). (#942, Antonin Décimo) ====== Deprecations ====== diff --git a/src/unix/unix_c/unix_closedir_job.c b/src/unix/unix_c/unix_closedir_job.c index 066cfd9f1..d28b53031 100644 --- a/src/unix/unix_c/unix_closedir_job.c +++ b/src/unix/unix_c/unix_closedir_job.c @@ -30,7 +30,7 @@ static void worker_closedir(struct job_closedir *job) static value result_closedir(struct job_closedir *job) { - LWT_UNIX_CHECK_JOB(job, job->dir < 0, "closedir"); + LWT_UNIX_CHECK_JOB(job, job->result < 0, "closedir"); lwt_unix_free_job(&job->job); return Val_unit; }