Subject: More fallout (Was: Build failure - libexec/ld.elf_so)
To: None <current-users@netbsd.org>
From: Geoff Wing <gcw@pobox.com>
List: current-users
Date: 08/17/2007 12:35:09
On Friday 2007-08-17 11:29 +1000, Geoff Wing output:
:On Friday 2007-08-17 10:46 +1000, Paul Goyette output:
::Ignore - it doesn't fix it after all.
::
::On Thu, 16 Aug 2007, Paul Goyette wrote:
::> The following patch makes this compile...

Following other patches are needed.

The include/rpcsvc/yp_prot.h could be savaged some more if needed

pppd and wpa patches aren't here and need changes in the dist dir.

Regards,
Geoff

------------------------------------------------------------

--- sbin/veriexecctl/veriexecctl.c.org	2007-05-16 16:49:08.000000000 +1000
+++ sbin/veriexecctl/veriexecctl.c	2007-08-17 11:42:27.000000000 +1000
@@ -198,7 +198,7 @@
 int
 main(int argc, char **argv)
 {
-	extern boolean_t keep_filename, eval_on_load;
+	extern bool keep_filename, eval_on_load;
 	int c;
 
 	setprogname(argv[0]);
@@ -206,11 +206,11 @@
 	while ((c = getopt(argc, argv, "ekv")) != -1)
 		switch (c) {
 		case 'e':
-			eval_on_load = TRUE;
+			eval_on_load = true;
 			break;
 
 		case 'k':
-			keep_filename = TRUE;
+			keep_filename = true;
 			break;
 
 		case 'v':
--- sbin/veriexecctl/veriexecctl_parse.y.org	2007-05-16 16:49:09.000000000 +1000
+++ sbin/veriexecctl/veriexecctl_parse.y	2007-08-17 11:42:00.000000000 +1000
@@ -37,6 +37,7 @@
 #include <ctype.h>
 #include <stdio.h>
 #include <string.h>
+#include <stdbool.h>
 #include <err.h>
 
 #include <prop/proplib.h>
@@ -47,7 +48,7 @@
 extern size_t line;
 extern int verbose, error;
 
-boolean_t keep_filename = FALSE, eval_on_load = FALSE;
+bool keep_filename = false, eval_on_load = false;
 prop_dictionary_t load_params;
 
 %}

------------------------------------------------------------

--- include/rpcsvc/yp_prot.h.org	2006-04-26 10:23:47.000000000 +1000
+++ include/rpcsvc/yp_prot.h	2007-08-17 11:51:45.000000000 +1000
@@ -64,7 +64,7 @@
  * YPPROC_MAPLIST	takes (char *), returns (struct ypmaplist *).
  */
 
-#ifndef BOOL_DEFINED
+#if !defined(BOOL_DEFINED) && !defined(__bool_true_false_are_defined)
 typedef u_int bool;
 #define BOOL_DEFINED
 #endif

------------------------------------------------------------

--- usr.bin/msgs/msgs.c.org	2003-08-09 12:02:05.000000000 +1000
+++ usr.bin/msgs/msgs.c	2007-08-17 12:00:43.000000000 +1000
@@ -88,6 +88,7 @@
 #include <termios.h>
 #include <time.h>
 #include <unistd.h>
+#include <stdbool.h>
 
 #include "pathnames.h"
 
@@ -105,8 +106,6 @@
 #define MORE	"More? [ynq]"
 #define NOMORE	"(No more) [q] ?"
 
-typedef	char	bool;
-
 FILE	*msgsrc;
 FILE	*newmsg;
 char	*sep = "-";

------------------------------------------------------------

--- usr.bin/netstat/mbuf.c.org	2005-08-05 19:29:35.000000000 +1000
+++ usr.bin/netstat/mbuf.c	2007-08-17 12:09:15.000000000 +1000
@@ -50,14 +50,12 @@
 #include <stdio.h>
 #include <kvm.h>
 #include <stdlib.h>
+#include <stdbool.h>
 #include <limits.h>
 #include <errno.h>
 #include <err.h>
 #include "netstat.h"
 
-#define	YES	1
-typedef int bool;
-
 struct	mbstat mbstat;
 struct pool mbpool, mclpool;
 struct pool_allocator mbpa, mclpa;
@@ -159,11 +157,11 @@
 	printf("%u mbufs in use:\n", totmbufs);
 	for (mp = mbtypes; mp->mt_name; mp++)
 		if (mbstat.m_mtypes[mp->mt_type]) {
-			seen[mp->mt_type] = YES;
+			seen[mp->mt_type] = true;
 			printf("\t%u mbufs allocated to %s\n",
 			    mbstat.m_mtypes[mp->mt_type], mp->mt_name);
 		}
-	seen[MT_FREE] = YES;
+	seen[MT_FREE] = true;
 	for (i = 0; i < nmbtypes; i++)
 		if (!seen[i] && mbstat.m_mtypes[i]) {
 			printf("\t%u mbufs allocated to <mbuf type %d>\n",

------------------------------------------------------------

--- usr.sbin/btdevctl/btdevctl.c.org	2007-04-21 19:20:01.000000000 +1000
+++ usr.sbin/btdevctl/btdevctl.c	2007-08-17 12:13:19.000000000 +1000
@@ -44,6 +44,7 @@
 #include <err.h>
 #include <fcntl.h>
 #include <stdlib.h>
+#include <stdbool.h>
 #include <string.h>
 #include <unistd.h>
 
@@ -65,23 +66,24 @@
 	prop_object_t obj;
 	bdaddr_t laddr, raddr;
 	const char *service, *mode;
-	int ch, query, verbose, attach, detach, set, none;
+	int ch;
+	bool query, verbose, attach, detach, set, none;
 
 	bdaddr_copy(&laddr, BDADDR_ANY);
 	bdaddr_copy(&raddr, BDADDR_ANY);
 	service = NULL;
 	mode = NULL;
-	query = FALSE;
-	verbose = FALSE;
-	attach = FALSE;
-	detach = FALSE;
-	set = FALSE;
-	none = FALSE;
+	query = false;
+	verbose = false;
+	attach = false;
+	detach = false;
+	set = false;
+	none = false;
 
 	while ((ch = getopt(argc, argv, "Aa:Dd:hm:qs:v")) != -1) {
 		switch (ch) {
 		case 'A': /* Attach device */
-			attach = TRUE;
+			attach = true;
 			break;
 
 		case 'a': /* remote address */
@@ -97,7 +99,7 @@
 			break;
 
 		case 'D': /* Detach device */
-			detach = TRUE;
+			detach = true;
 			break;
 
 		case 'd': /* local device address */
@@ -108,7 +110,7 @@
 
 		case 'm': /* link mode */
 			if (strcasecmp(optarg, "none") == 0)
-				none = TRUE;
+				none = true;
 			else if (strcasecmp(optarg, BTDEVauth) == 0)
 				mode = BTDEVauth;
 			else if (strcasecmp(optarg, BTDEVencrypt) == 0)
@@ -121,7 +123,7 @@
 			break;
 
 		case 'q':
-			query = TRUE;
+			query = true;
 			break;
 
 		case 's': /* service */
@@ -129,7 +131,7 @@
 			break;
 
 		case 'v': /* verbose */
-			verbose = TRUE;
+			verbose = true;
 			break;
 
 		case 'h':
@@ -142,25 +144,25 @@
 	argv += optind;
 
 	if (argc > 0
-	    || (attach == TRUE && detach == TRUE)
+	    || (attach == true && detach == true)
 	    || bdaddr_any(&laddr)
 	    || bdaddr_any(&raddr)
 	    || service == NULL)
 		usage();
 
-	if (attach == FALSE && detach == FALSE)
-		verbose = TRUE;
+	if (attach == false && detach == false)
+		verbose = true;
 
 	dev = db_get(&laddr, &raddr, service);
-	if (dev == NULL || query == TRUE) {
-		if (verbose == TRUE)
+	if (dev == NULL || query == true) {
+		if (verbose == true)
 			printf("Performing SDP query for service '%s'..\n", service);
 
 		dev = cfg_query(&laddr, &raddr, service);
 		if (dev == NULL)
 			errx(EXIT_FAILURE, "%s/%s not found", bt_ntoa(&raddr, NULL), service);
 
-		set = TRUE;
+		set = true;
 	}
 
 	if (mode != NULL) {
@@ -169,15 +171,15 @@
 			errx(EXIT_FAILURE, "proplib failure (%s)", BTDEVmode);
 
 		prop_object_release(obj);
-		set = TRUE;
+		set = true;
 	}
 
-	if (none == TRUE) {
+	if (none == true) {
 		prop_dictionary_remove(dev, BTDEVmode);
-		set = TRUE;
+		set = true;
 	}
 
-	if (set == TRUE && !db_set(dev, &laddr, &raddr, service))
+	if (set == true && !db_set(dev, &laddr, &raddr, service))
 		errx(EXIT_FAILURE, "service store failed");
 
 	/* add binary local-bdaddr */
@@ -201,13 +203,13 @@
 
 	prop_object_release(obj);
 
-	if (verbose == TRUE)
+	if (verbose == true)
 		cfg_print(dev);
 
-	if (attach == TRUE)
+	if (attach == true)
 		bthub_pioctl(BTDEV_ATTACH, dev);
 
-	if (detach == TRUE)
+	if (detach == true)
 		bthub_pioctl(BTDEV_DETACH, dev);
 
 	exit(EXIT_SUCCESS);
--- usr.sbin/btdevctl/db.c.org	2007-04-21 19:20:01.000000000 +1000
+++ usr.sbin/btdevctl/db.c	2007-08-17 12:18:31.000000000 +1000
@@ -37,6 +37,7 @@
 #include <bluetooth.h>
 #include <err.h>
 #include <stdlib.h>
+#include <stdbool.h>
 
 #include <prop/proplib.h>
 
@@ -50,7 +51,7 @@
 #define BTDEVCTL_VERSION	2
 
 static prop_dictionary_t db = NULL;
-static int db_flush = TRUE;		/* write db on set */
+static bool db_flush = true;		/* write db on set */
 
 static void db_update0(void);
 static void db_update1(void);
@@ -137,7 +138,7 @@
 	if (!prop_dictionary_set(rdev, service, dev))
 		return 0;
 
-	if (db_flush == TRUE) {
+	if (db_flush == true) {
 		version = prop_number_create_integer(BTDEVCTL_VERSION);
 		if (version == NULL)
 			err(EXIT_FAILURE, "prop_number_create_integer");
@@ -171,7 +172,7 @@
 	bdaddr_t laddr, raddr;
 	const char *service;
 
-	db_flush = FALSE;	/* no write on set */
+	db_flush = false;	/* no write on set */
 	old = db;
 
 	db = prop_dictionary_create();
@@ -220,7 +221,7 @@
 	prop_object_iterator_release(iter);
 	prop_object_release(old);
 
-	db_flush = TRUE;	/* write on set */
+	db_flush = true;	/* write on set */
 }
 
 /*
--- usr.sbin/btdevctl/sdp.c.org	2007-04-21 19:20:01.000000000 +1000
+++ usr.sbin/btdevctl/sdp.c	2007-08-17 12:15:11.000000000 +1000
@@ -297,7 +297,7 @@
 	prop_object_release(obj);
 
 	if (!reconnect_initiate) {
-		obj = prop_bool_create(TRUE);
+		obj = prop_bool_create(true);
 		if (obj == NULL || !prop_dictionary_set(dict, BTHIDEVreconnect, obj))
 			return errno;
 
@@ -380,7 +380,7 @@
 
 	prop_object_release(obj);
 
-	obj = prop_bool_create(TRUE);
+	obj = prop_bool_create(true);
 	if (obj == NULL || !prop_dictionary_set(dict, BTSCOlisten, obj))
 		return errno;
 
------------------------------------------------------------

--- usr.sbin/mrouted/defs.h.org	2007-02-22 12:45:51.000000000 +1100
+++ usr.sbin/mrouted/defs.h	2007-08-17 12:20:24.000000000 +1000
@@ -256,7 +256,7 @@
 
 /* kern.c */
 extern void		k_set_rcvbuf(int bufsize);
-extern void		k_hdr_include(int bool);
+extern void		k_hdr_include(int bbool);
 extern void		k_set_ttl(int t);
 extern void		k_set_loop(int l);
 extern void		k_set_if(u_int32_t ifa);
--- usr.sbin/mrouted/kern.c.org	2006-05-11 11:26:31.000000000 +1000
+++ usr.sbin/mrouted/kern.c	2007-08-17 12:21:03.000000000 +1000
@@ -21,12 +21,12 @@
 }
 
 
-void k_hdr_include(int bool)
+void k_hdr_include(int bbool)
 {
 #ifdef IP_HDRINCL
     if (setsockopt(igmp_socket, IPPROTO_IP, IP_HDRINCL,
-		   (char *)&bool, sizeof(bool)) < 0)
-	logit(LOG_ERR, errno, "setsockopt IP_HDRINCL %u", bool);
+		   (char *)&bbool, sizeof(bbool)) < 0)
+	logit(LOG_ERR, errno, "setsockopt IP_HDRINCL %u", bbool);
 #endif
 }
 
------------------------------------------------------------