aboutsummaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorScott Long <scottl@FreeBSD.org>2020-11-15 20:24:59 +0000
committerScott Long <scottl@FreeBSD.org>2020-11-15 20:24:59 +0000
commit8e1031086d40b9bd3fa255d92cc45573e3afed16 (patch)
treee3cb8206851bd27dac89f9e7d562fe4c364931d2 /sbin
parentfc7cf7241f89a3d3ccc20cb49c5bf61e154b7a1b (diff)
downloadsrc-8e1031086d40b9bd3fa255d92cc45573e3afed16.tar.gz
src-8e1031086d40b9bd3fa255d92cc45573e3afed16.zip
Revert the whole getlocalbase() set of changes while a different design is
hashed out.
Notes
Notes: svn path=/head/; revision=367711
Diffstat (limited to 'sbin')
-rw-r--r--sbin/nvmecontrol/comnd.c2
-rw-r--r--sbin/nvmecontrol/comnd.h2
-rw-r--r--sbin/nvmecontrol/nvmecontrol.c11
3 files changed, 4 insertions, 11 deletions
diff --git a/sbin/nvmecontrol/comnd.c b/sbin/nvmecontrol/comnd.c
index 2f0db309bf68..b8c9abc86844 100644
--- a/sbin/nvmecontrol/comnd.c
+++ b/sbin/nvmecontrol/comnd.c
@@ -287,7 +287,7 @@ bad_arg:
* Loads all the .so's from the specified directory.
*/
void
-cmd_load_dir(char *dir, cmd_load_cb_t cb, void *argp)
+cmd_load_dir(const char *dir __unused, cmd_load_cb_t cb __unused, void *argp __unused)
{
DIR *d;
struct dirent *dent;
diff --git a/sbin/nvmecontrol/comnd.h b/sbin/nvmecontrol/comnd.h
index 9dedb7a7057d..91c97d4a873f 100644
--- a/sbin/nvmecontrol/comnd.h
+++ b/sbin/nvmecontrol/comnd.h
@@ -96,7 +96,7 @@ void cmd_register(struct cmd *, struct cmd *);
int arg_parse(int argc, char * const *argv, const struct cmd *f);
void arg_help(int argc, char * const *argv, const struct cmd *f);
void cmd_init(void);
-void cmd_load_dir(char *dir, cmd_load_cb_t *cb, void *argp);
+void cmd_load_dir(const char *dir, cmd_load_cb_t *cb, void *argp);
int cmd_dispatch(int argc, char *argv[], const struct cmd *);
#endif /* COMND_H */
diff --git a/sbin/nvmecontrol/nvmecontrol.c b/sbin/nvmecontrol/nvmecontrol.c
index 733a475c8721..758822f2e25a 100644
--- a/sbin/nvmecontrol/nvmecontrol.c
+++ b/sbin/nvmecontrol/nvmecontrol.c
@@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$");
#include <err.h>
#include <errno.h>
#include <fcntl.h>
-#include <libutil.h>
#include <paths.h>
#include <stdbool.h>
#include <stddef.h>
@@ -179,17 +178,11 @@ get_nsid(int fd, char **ctrlr_str, uint32_t *nsid)
int
main(int argc, char *argv[])
{
- char locallib[MAXPATHLEN];
- size_t len;
cmd_init();
- snprintf(locallib, MAXPATHLEN, "/lib/nvmecontrol");
- cmd_load_dir(locallib, NULL, NULL);
- if ((len = getlocalbase(locallib, MAXPATHLEN)) > 0) {
- strlcat(locallib, "/lib/nvmecontrol", MAXPATHLEN);
- cmd_load_dir(locallib, NULL, NULL);
- }
+ cmd_load_dir("/lib/nvmecontrol", NULL, NULL);
+ cmd_load_dir(_PATH_LOCALBASE "/lib/nvmecontrol", NULL, NULL);
cmd_dispatch(argc, argv, NULL);