pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/devel/gmake



Module Name:    pkgsrc
Committed By:   mrg
Date:           Tue Aug 20 07:07:53 UTC 2024

Modified Files:
        pkgsrc/devel/gmake: Makefile distinfo
Added Files:
        pkgsrc/devel/gmake/patches: patch-src_dir.c

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.


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 pkgsrc/devel/gmake/Makefile
cvs rdiff -u -r1.45 -r1.46 pkgsrc/devel/gmake/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/devel/gmake/patches/patch-src_dir.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/devel/gmake/Makefile
diff -u pkgsrc/devel/gmake/Makefile:1.122 pkgsrc/devel/gmake/Makefile:1.123
--- pkgsrc/devel/gmake/Makefile:1.122   Wed Mar 29 08:27:59 2023
+++ pkgsrc/devel/gmake/Makefile Tue Aug 20 07:07:52 2024
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.122 2023/03/29 08:27:59 wiz Exp $
+# $NetBSD: Makefile,v 1.123 2024/08/20 07:07:52 mrg Exp $
 
 DISTNAME=      make-4.4.1
 PKGNAME=       g${DISTNAME}
+PKGREVISION=   1
 CATEGORIES=    devel
 MASTER_SITES=  ${MASTER_SITE_GNU:=make/}
 

Index: pkgsrc/devel/gmake/distinfo
diff -u pkgsrc/devel/gmake/distinfo:1.45 pkgsrc/devel/gmake/distinfo:1.46
--- pkgsrc/devel/gmake/distinfo:1.45    Wed Mar 29 08:27:59 2023
+++ pkgsrc/devel/gmake/distinfo Tue Aug 20 07:07:53 2024
@@ -1,8 +1,9 @@
-$NetBSD: distinfo,v 1.45 2023/03/29 08:27:59 wiz Exp $
+$NetBSD: distinfo,v 1.46 2024/08/20 07:07:53 mrg Exp $
 
 BLAKE2s (make-4.4.1.tar.gz) = 7a4c4b3044fc22063849216e62500d329566297dd5a8fbf2ad6e7b888d31206f
 SHA512 (make-4.4.1.tar.gz) = 145260cbd6a8226cef3dfef0c8baba31847beaebc7e6b65d39d02715fd4f4cab9b139b6c3772e550088d4f9ae80c6d3ed20b9a7664c693644dfb96b4cb60e67c
 Size (make-4.4.1.tar.gz) = 2348200 bytes
 SHA1 (patch-af) = 8ff060ecba9d664044eabd98741253881d8c9bbe
+SHA1 (patch-src_dir.c) = 31812ce955b9ebb1e16db90bd7a6e0a4258eebc2
 SHA1 (patch-src_hash.c) = 755de04a4f9a63f5bfc2520026344d6dc8654992
 SHA1 (patch-src_job.c) = 848eaafc6dfc5086a3d46f9dae387b39d5c514c6

Added files:

Index: pkgsrc/devel/gmake/patches/patch-src_dir.c
diff -u /dev/null pkgsrc/devel/gmake/patches/patch-src_dir.c:1.1
--- /dev/null   Tue Aug 20 07:07:53 2024
+++ pkgsrc/devel/gmake/patches/patch-src_dir.c  Tue Aug 20 07:07:53 2024
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_dir.c,v 1.1 2024/08/20 07:07:53 mrg Exp $
+
+readdir(3) does not change errno if it fails due to end-of-directory, so
+must set errno = 0 before hand, if using it for this check.
+
+--- src/dir.c.orig     2023-01-11 16:53:26.000000000 -0800
++++ src/dir.c  2024-08-20 00:00:46.979555824 -0700
+@@ -730,6 +730,7 @@
+       struct dirfile dirfile_key;
+       struct dirfile **dirfile_slot;
+ 
++      errno = 0;
+       ENULLLOOP (d, readdir (dc->dirstream));
+       if (d == NULL)
+         {



Home | Main Index | Thread Index | Old Index