Use constant defined in spl / post-0.8.0 libspl, for HOSTID file.
Also allows get_system_hostid() to be pulled in from ZFS 0.8.x
Test-Parameters: trivial
Signed-off-by: Nathaniel Clark <nclark@whamcloud.com>
Change-Id: Iba70d4f3b7f237260bdc964b28b601deeee81208
Reviewed-on: https://review.whamcloud.com/34278
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Olaf Faaland-LLNL <faaland1@llnl.gov>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
#include <stdio.h>
#include <string.h>
#include <libzfs.h>
#include <stdio.h>
#include <string.h>
#include <libzfs.h>
-
-#define HOSTID_PATH "/etc/hostid"
+#include <sys/systeminfo.h>
/* Persistent mount data is stored in these user attributes */
#define LDD_PREFIX "lustre:"
/* Persistent mount data is stored in these user attributes */
#define LDD_PREFIX "lustre:"
if (hostid != 0)
return 0;
if (hostid != 0)
return 0;
- f = fopen(HOSTID_PATH, "r");
+ f = fopen(HW_HOSTID_PATH, "r");
fclose(f);
if (rc != 1) {
fclose(f);
if (rc != 1) {
- fprintf(stderr, "Failed to read "HOSTID_PATH": %d\n",
+ fprintf(stderr, "Failed to read "HW_HOSTID_PATH": %d\n",