Path to this page:
Subject: CVS commit: pkgsrc/devel/gmake
From: matthew green
Date: 2024-08-20 09:07:53
Message id: 20240820070753.56E98FC74@cvs.NetBSD.org
Log Message:
fix the "gmake readdir" fails bug.
i had a look and there are only 2 calls to readdir() in gmake, and one
of them doesn't have the error. the code around the other one assumes
that readdir(), when returning NULL for "end of directory", has cleared
errno, but this isn't required and infact, is *not* expected. the 2024
opengroup definition of readdir explicitly says:
When the end of the directory is encountered, a null pointer shall
be returned and errno is not changed.
the netbsd readdir() does not change errno in this case.
this bug is difficult to reproduce, but setting "errno = 0" before this
call to readdir() *should* avoid it.
Files: