summaryrefslogtreecommitdiff
path: root/sbin/nvmecontrol/nvmecontrol.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/nvmecontrol/nvmecontrol.c')
-rw-r--r--sbin/nvmecontrol/nvmecontrol.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sbin/nvmecontrol/nvmecontrol.c b/sbin/nvmecontrol/nvmecontrol.c
index 758822f2e25a..68a2ecb9b0b8 100644
--- a/sbin/nvmecontrol/nvmecontrol.c
+++ b/sbin/nvmecontrol/nvmecontrol.c
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
#include <err.h>
#include <errno.h>
#include <fcntl.h>
+#include <libutil.h>
#include <paths.h>
#include <stdbool.h>
#include <stddef.h>
@@ -178,11 +179,13 @@ get_nsid(int fd, char **ctrlr_str, uint32_t *nsid)
int
main(int argc, char *argv[])
{
+ static char dir[MAXPATHLEN];
cmd_init();
cmd_load_dir("/lib/nvmecontrol", NULL, NULL);
- cmd_load_dir(_PATH_LOCALBASE "/lib/nvmecontrol", NULL, NULL);
+ snprintf(dir, MAXPATHLEN, "%s/lib/nvmecontrol", getlocalbase());
+ cmd_load_dir(dir, NULL, NULL);
cmd_dispatch(argc, argv, NULL);