Skip to content

Commit

Permalink
Fix unix_closedir_job incorrectly checking return value of job
Browse files Browse the repository at this point in the history
LWT_UNIX_CHECK_JOB was incorrectly checking the directory stream
instead of the return value of closedir.
  • Loading branch information
MisterDA committed Apr 13, 2022
1 parent 5e3f792 commit ee61edf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,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 Lwt_unix.closedir incorrectly checking the return value of closedir(3). (#942, Antonin Décimo)

====== Deprecations ======

Expand Down
2 changes: 1 addition & 1 deletion src/unix/unix_c/unix_closedir_job.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit ee61edf

Please sign in to comment.