[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[dm-devel] Re: [lvm-devel] Allow $DM_DEVDIR envvar to override default of "/dev".

On Mon, Oct 08, 2007 at 07:25:56PM +0200, Jim Meyering wrote:
> any existing LVM set-up, I've been using LVM_SYSTEM_DIR to specify

> Here's a patch to make dmsetup honor a new DM_DEVDIR envvar,

Small point, but should that be DM_DEV_DIR for consistency with

> +	} else {
> +		dev_dir = "/dev";

Can you make that a #define at the top of the file?
(Try to keep hard-coded values easy to spot.)

> +	if (*dev_dir != '/')
> +		return 0;

log_error ?
(Functions should produce an error message as close as possible to the
place the problem is detected; all functions that return failure must
log a message before returning - using a macro like 'stack' if you don't
want the user to see it.  The only exceptions (very rare) are functions
expected to fail frequently that would produce too many log messages.)

> +	if (snprintf(_dm_dir, sizeof _dm_dir, "%s%s%s", dev_dir, slash, DM_DIR)
> +	    >= sizeof _dm_dir)
> +		return 0;

and here

Also consider dm_snprintf rather than snprintf.
[lvm2 uses this, but bits of dm haven't been converted]

agk redhat com

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]