aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libzpool
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libzpool')
-rw-r--r--lib/libzpool/include/sys/zfs_context.h4
-rw-r--r--lib/libzpool/kernel.c7
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/libzpool/include/sys/zfs_context.h b/lib/libzpool/include/sys/zfs_context.h
index 0e7019bba..a50e4b0ac 100644
--- a/lib/libzpool/include/sys/zfs_context.h
+++ b/lib/libzpool/include/sys/zfs_context.h
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -490,7 +490,7 @@ typedef struct callb_cpr {
/*
* Hostname information
*/
-extern char hw_serial[];
+extern char hw_serial[]; /* for userland-emulated hostid access */
extern int ddi_strtoul(const char *str, char **nptr, int base,
unsigned long *result);
diff --git a/lib/libzpool/kernel.c b/lib/libzpool/kernel.c
index fe817cc64..89108fe5b 100644
--- a/lib/libzpool/kernel.c
+++ b/lib/libzpool/kernel.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -36,6 +36,7 @@
#include <sys/zfs_context.h>
#include <sys/zmod.h>
#include <sys/utsname.h>
+#include <sys/systeminfo.h>
/*
* Emulation of kernel services in userland.
@@ -43,7 +44,7 @@
uint64_t physmem;
vnode_t *rootdir = (vnode_t *)0xabcd1234;
-char hw_serial[11];
+char hw_serial[HW_HOSTID_LEN];
struct utsname utsname = {
"userland", "libzpool", "1", "1", "na"
@@ -778,7 +779,7 @@ kernel_init(int mode)
dprintf("physmem = %llu pages (%.2f GB)\n", physmem,
(double)physmem * sysconf(_SC_PAGE_SIZE) / (1ULL << 30));
- snprintf(hw_serial, sizeof (hw_serial), "%ld", gethostid());
+ (void) snprintf(hw_serial, sizeof (hw_serial), "%ld", gethostid());
VERIFY((random_fd = open("/dev/random", O_RDONLY)) != -1);
VERIFY((urandom_fd = open("/dev/urandom", O_RDONLY)) != -1);