Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Jul 2011 16:56:14 +0200
From:      Robert Millan <rmh@debian.org>
To:        freebsd-hackers@freebsd.org, Ed Maste <emaste@freebsd.org>
Subject:   [PATCH] build config(8) on GNU systems
Message-ID:  <CAOfDtXP-vZ=qDKZuw0P7=NwX5BfUpqqvGsLLrVHTjrnaRjcMhQ@mail.gmail.com>

next in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Hi!

Please consider this small patch to make config(8) buildable on GNU
systems.

Thanks

-- 
Robert Millan

[-- Attachment #2 --]
Index: usr.sbin/config/main.c
===================================================================
--- usr.sbin/config/main.c	(revision 223721)
+++ usr.sbin/config/main.c	(working copy)
@@ -591,7 +591,11 @@
 	if ((dirp = opendir(p)) == NULL)
 		err(EX_OSERR, "opendir %s", p);
 	while ((dp = readdir(dirp)) != NULL) {
+#ifdef _DIRENT_HAVE_D_NAMLEN
 		i = dp->d_namlen - 2;
+#else
+		i = strlen (dp->d_name) - 2;
+#endif
 		/* Skip non-headers */
 		if (dp->d_name[i] != '.' || dp->d_name[i + 1] != 'h')
 			continue;

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOfDtXP-vZ=qDKZuw0P7=NwX5BfUpqqvGsLLrVHTjrnaRjcMhQ>