[lm-sensors] [PATCH 4/6] Read extra configuration files from /etc/sensors.d

Charles CharlesA at auroville.org.in
Fri Feb 13 12:49:36 CET 2009


Hello  :-)

>> +the default configuration file. Files those name starts with a dot are
                                           ^
> Spelling: "Files whose name starts"

Better "Files with names that start"?

"Whose" is the possessive form of "who"; historically it was used only when
the possessor was animate.  This usage is loosening to accommodate inanimate
possessors (including *n*x files!) but is still controversial.  "Files with
names that start" is uncontroversial and, IMHO, more elegant and natural
than "Files whose name starts".

Best

Charles

========================================================================
Date: Thu, 12 Feb 2009 23:23:12 -0600 (CST)
From: Matt Roberds <mattroberds at cox.net>
Subject: Re: [lm-sensors] [PATCH 4/6] Read extra configuration files
	from	/etc/sensors.d
To: Jean Delvare <khali at linux-fr.org>
Cc: LM Sensors <lm-sensors at lm-sensors.org>
Message-ID: <Pine.LNX.4.64.0902122322560.32383 at birdbird.example.com>
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

On Wed, 11 Feb 2009, Jean Delvare wrote:
> Read extra configuration files from /etc/sensors.d.

[...]
> +static int add_config_from_dir(const char *dir)
[...]
> +	for (res = 0, i = 0; !res && i < count; i++) {
> +		int len;
> +		char path[16 + NAME_MAX];
> +		FILE *input;
> +
> +		len = snprintf(path, sizeof(path), "%s/%s", dir,
> +			       namelist[i]->d_name);
> +		if (len < 0 || len >= (int)sizeof(path)) {
> +			res = -SENSORS_ERR_PARSE;
> +			continue;
> +		}

This says that the maximum length of the path to the config files is 16
characters?  Seems kind of short.  By default this will be
"/etc/sensors.d/" which clocks in at 15 bytes.  If somebody wants to use
(say) "/usr/local/etc/sensors.d/" they'll be out of luck.  Maybe
something like

char path[PATH_MAX + NAME_MAX];

would be better?

> +++ lm-sensors/lib/sensors.conf.5	2009-02-11 10:30:22.000000000 +0100
[...]
> +A directory where you can put additional libsensors configuration files.
> +Files found in this directory will be processed in alphabetical order
after
> +the default configuration file. Files those name starts with a dot are
                                           ^
Spelling: "Files whose name starts"

> +++ lm-sensors/lib/libsensors.3	2009-02-11 10:29:09.000000000 +0100
[...]
> +A directory where you can put additional libsensors configuration files.
> +Files found in this directory will be processed in alphabetical order
after
> +the default configuration file. Files those name starts with a dot are
                                           ^
Spelling: "Files whose name starts"

Matt Roberds





More information about the lm-sensors mailing list