config files

Iain Hibbert plunky at rya-online.net
Sun Mar 12 21:18:16 UTC 2006


On Thu, 9 Mar 2006, Maksim Yevmenkin wrote:

> i do not like this idea. having one huge config file for every possible
> bluetooth application seems like a bad thing to me. i agree, parser code can
> be moved in libbluetooth (or whatever), but config files should stay separate.

well, yes - one massive file could be bad though not sure how many remote
bluetooth devices would be in it anyway?

Its just that to add a mouse to the system, I needed to enter details in 3
files (and, details are held in two more) which could be considered a bit
much just for a mouse :)

vaguely related to this, would the attached patch work to reload
bthidd.conf on SIGHUP? It seems that it should, though I'm not sure if the
fact that the new_device field is set would be an issue (maybe not, if the
session already exists?)

iain
-------------- next part --------------
--- bthidd.c.orig	2004-11-18 18:05:15.000000000 +0000
+++ bthidd.c	2006-03-12 20:10:02.000000000 +0000
@@ -55,7 +55,8 @@
  * bthidd
  */
 
-static int	done = 0; /* are we done? */
+static int	done = 0;	/* are we done? */
+static int	reload = 0;	/* reload config file */
 
 int
 main(int argc, char *argv[])
@@ -169,6 +170,11 @@
 
 		if (server_do(&srv) < 0)
 			break;
+
+		if (reload && read_config_file() < 0)
+			break;
+
+		reload = 0;
 	}
 
 	server_shutdown(&srv);
@@ -249,6 +255,9 @@
 {
 	syslog(LOG_NOTICE, "Got signal %d, total number of signals %d",
 		s, ++ done);
+
+	if (s == SIGHUP)
+		reload = 1;
 }
 
 /*


More information about the freebsd-bluetooth mailing list