Skip to content

Fix unix_closedir_job incorrectly checking return value of job - #942

Merged
raphael-proust merged 1 commit into
ocsigen:masterfrom
MisterDA:unix-closedir-check-job
Jun 21, 2022
Merged

raphael-proust merged 1 commit into
ocsigen:masterfrom
MisterDA:unix-closedir-check-job

Conversation

@MisterDA

Copy link
Copy Markdown
Contributor

LWT_UNIX_CHECK_JOB was incorrectly checking the directory stream
instead of the return value of closedir.

@raphael-proust

Copy link
Copy Markdown
Collaborator

Thanks for this fix! I've grepped for the LWT_UNIX_CHECK_JOB and there are a couple of suspicious

@raphael-proust

Copy link
Copy Markdown
Collaborator

There are a couple uses of LWT_UNIX_CHECK_JOB which could be simplified (they use job->result != 0 which should be the same as just job->result IIUC) and some that are somewhat arbitrarily specific (e.g., the check for closedir has job->result < 0 but the manpage for closedir mentions 0 on success and -1 on error, so we could either leave job->result).

Anyway, I didn't find errors in any of these other instances. So I'm merging this. (After rebase and CI.)

LWT_UNIX_CHECK_JOB was incorrectly checking the directory stream
instead of the return value of closedir.
@raphael-proust
raphael-proust force-pushed the unix-closedir-check-job branch from ee61edf to b27437f Compare June 21, 2022 06:59
@raphael-proust
raphael-proust merged commit 449f180 into ocsigen:master Jun 21, 2022
@MisterDA
MisterDA deleted the unix-closedir-check-job branch June 21, 2022 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants