Skip to content

Commit

Permalink
zpool: main: print hostids with PRIx64
Browse files Browse the repository at this point in the history
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes openzfs#12968
  • Loading branch information
nabijaczleweli authored and nicman23 committed Aug 22, 2022
1 parent 20905a6 commit cb9abaa
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions cmd/zpool/zpool_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3039,9 +3039,8 @@ show_import(nvlist_t *config, boolean_t report_error)
ZPOOL_CONFIG_MMP_HOSTID);

(void) printf(gettext(" action: The pool must be "
"exported from %s (hostid=%lx)\n\tbefore it "
"can be safely imported.\n"), hostname,
(unsigned long) hostid);
"exported from %s (hostid=%"PRIx64")\n\tbefore it "
"can be safely imported.\n"), hostname, hostid);
break;
case ZPOOL_STATUS_HOSTID_REQUIRED:
(void) printf(gettext(" action: Set a unique system "
Expand Down Expand Up @@ -3170,9 +3169,9 @@ do_import(nvlist_t *config, const char *newname, const char *mntopts,

(void) fprintf(stderr, gettext("cannot import '%s': "
"pool is imported on %s (hostid: "
"0x%lx)\nExport the pool on the other system, "
"then run 'zpool import'.\n"),
name, hostname, (unsigned long) hostid);
"0x%"PRIx64")\nExport the pool on the other "
"system, then run 'zpool import'.\n"),
name, hostname, hostid);
} else if (mmp_state == MMP_STATE_NO_HOSTID) {
(void) fprintf(stderr, gettext("Cannot import '%s': "
"pool has the multihost property on and the\n"
Expand All @@ -3197,10 +3196,10 @@ do_import(nvlist_t *config, const char *newname, const char *mntopts,

(void) fprintf(stderr, gettext("cannot import '%s': "
"pool was previously in use from another system.\n"
"Last accessed by %s (hostid=%lx) at %s"
"Last accessed by %s (hostid=%"PRIx64") at %s"
"The pool can be imported, use 'zpool import -f' "
"to import the pool.\n"), name, hostname,
(unsigned long)hostid, ctime(&timestamp));
hostid, ctime(&timestamp));
}

return (1);
Expand Down

0 comments on commit cb9abaa

Please sign in to comment.