Subject: mkfontscale and fc-cache hang on OpenBSD
To: None <tech-pkg@NetBSD.org>
From: HIRAMATSU Yoshifumi <hiramatu@boreas.dti.ne.jp>
List: tech-pkg
Date: 10/07/2005 18:33:58
--Multipart_Fri_Oct__7_18:33:58_2005-1
Content-Type: text/plain; charset=US-ASCII

Hi,

When I trid to build meta-pkgs/xorg on OpenBSD, mkfontscale and
fc-cache hang while building font meta data.

It seems that both program loops while trying to process directory as
a font file, so I modified these programs not to open directories.

Can I commit this?

-- 
// HIRAMATSU Yoshifumi
// hiramatu@boreas.dti.ne.jp


--Multipart_Fri_Oct__7_18:33:58_2005-1
Content-Type: application/octet-stream; type=patch
Content-Disposition: attachment; filename="fontconfig.diff"
Content-Transfer-Encoding: 7bit

diff -buNr fontconfig.orig/distinfo fontconfig/distinfo
--- fontconfig.orig/distinfo	Fri Oct  7 08:12:03 2005
+++ fontconfig/distinfo	Fri Oct  7 08:08:11 2005
@@ -5,3 +5,4 @@
 Size (fontconfig-2.3.2.tar.gz) = 964045 bytes
 SHA1 (patch-aa) = 4f39b7726c11cc9d91fba0c840f26404702c0353
 SHA1 (patch-ac) = df8b145c38476e5caa1f4636be4eb56654bd11d0
+SHA1 (patch-ad) = 0b1e766d6d1222e1f72ed2258269ffb214410165
diff -buNr fontconfig.orig/patches/patch-ad fontconfig/patches/patch-ad
--- fontconfig.orig/patches/patch-ad	Thu Jan  1 09:00:00 1970
+++ fontconfig/patches/patch-ad	Fri Oct  7 08:08:11 2005
@@ -0,0 +1,14 @@
+--- src/fcdir.c.orig	Fri Feb 11 05:20:02 2005
++++ src/fcdir.c	Fri Oct  7 07:17:37 2005
+@@ -234,7 +234,11 @@
+     }
+     while (ret && (e = readdir (d)))
+     {
++#ifdef __OpenBSD__
++	if (e->d_type != DT_DIR && strlen (e->d_name) < FC_MAX_FILE_LEN)
++#else
+ 	if (e->d_name[0] != '.' && strlen (e->d_name) < FC_MAX_FILE_LEN)
++#endif
+ 	{
+ 	    strcpy ((char *) base, (char *) e->d_name);
+ 	    ret = FcFileScanConfig (set, dirs, cache, blanks, file, force, config);

--Multipart_Fri_Oct__7_18:33:58_2005-1
Content-Type: application/octet-stream; type=patch
Content-Disposition: attachment; filename="xorg-libs.diff"
Content-Transfer-Encoding: 7bit

diff -buNr xorg-libs.orig/distinfo xorg-libs/distinfo
--- xorg-libs.orig/distinfo	Tue Oct  4 09:47:26 2005
+++ xorg-libs/distinfo	Fri Oct  7 08:11:44 2005
@@ -46,3 +46,4 @@
 SHA1 (patch-bk) = e8b5eca5ce2d3acc77797f16f956dfc9a2fcacc8
 SHA1 (patch-bl) = 061ef890491cc131e70c6329a30c9f28a301df92
 SHA1 (patch-bm) = 7cd02712c1ae4ca070564d2f7b5cb4e3e5b6e93b
+SHA1 (patch-bn) = 29bd07b33d079ce14b5f04694aa443f82ff3a5ac
diff -buNr xorg-libs.orig/patches/patch-bn xorg-libs/patches/patch-bn
--- xorg-libs.orig/patches/patch-bn	Thu Jan  1 09:00:00 1970
+++ xorg-libs/patches/patch-bn	Fri Oct  7 08:11:44 2005
@@ -0,0 +1,15 @@
+--- programs/mkfontscale/mkfontscale.c.orig	Mon Sep 26 10:25:30 2005
++++ programs/mkfontscale/mkfontscale.c	Mon Sep 26 10:31:41 2005
+@@ -813,6 +813,12 @@
+         char *xlfd_name = NULL;
+         xlfd = NULL;
+ 
++#ifdef __OpenBSD__
++	if(entry->d_type == DT_DIR) {
++		continue;
++	}
++#endif
++
+ 	if (xl) {
+ 	    int dl = strlen (entry->d_name);
+ 	    if (strcmp (entry->d_name + dl - xl, exclusionSuffix) == 0)

--Multipart_Fri_Oct__7_18:33:58_2005-1--