From 99639e4a13306c3809b52e487d4343d756fad2e2 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Thu, 19 Feb 2009 11:26:17 -0800 Subject: Add zone_get_hostid() function Minimal support added for the zone_get_hostid() function. Only global zones are supported therefore this function must be called with a NULL argumment. Additionally, I've added the HW_HOSTID_LEN define and updated all instances where a hard coded magic value of 11 was used; "A good riddance of bad rubbish!" --- module/spl/spl-proc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'module/spl/spl-proc.c') diff --git a/module/spl/spl-proc.c b/module/spl/spl-proc.c index 1ae1c129a..90c89ce31 100644 --- a/module/spl/spl-proc.c +++ b/module/spl/spl-proc.c @@ -470,7 +470,8 @@ proc_dohostid(struct ctl_table *table, int write, struct file *filp, RETURN(-EINVAL); spl_hostid = (long)val; - (void)snprintf(hw_serial, 11, "%u", (val >= 0) ? val : -val); + (void)snprintf(hw_serial, HW_HOSTID_LEN-1, "%u", + (val >= 0) ? val : -val); *ppos += *lenp; } else { len = snprintf(str, sizeof(str), "%lx", spl_hostid); -- cgit v1.2.3