diff options
author | Alexander Motin <mav@FreeBSD.org> | 2022-03-07 16:06:11 +0000 |
---|---|---|
committer | Alexander Motin <mav@FreeBSD.org> | 2022-03-07 16:12:25 +0000 |
commit | 2117cdd4b4ebda7db0270c56f5a3cbdd37ec8cfc (patch) | |
tree | 12d5cf32f6cdd900fffc89b1b80fe1e7e8682767 /sbin/gvinum | |
parent | 01b9c48b5dec8d4a1161e0592f04b3301c81a1f8 (diff) | |
download | src-2117cdd4b4ebda7db0270c56f5a3cbdd37ec8cfc.tar.gz src-2117cdd4b4ebda7db0270c56f5a3cbdd37ec8cfc.zip |
Diffstat (limited to 'sbin/gvinum')
-rw-r--r-- | sbin/gvinum/gvinum.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sbin/gvinum/gvinum.c b/sbin/gvinum/gvinum.c index 50947a30a725..5a081e92a8df 100644 --- a/sbin/gvinum/gvinum.c +++ b/sbin/gvinum/gvinum.c @@ -575,13 +575,15 @@ find_name(const char *prefix, int type, int namelen) char line[1024]; comment[0] = '\0'; + buf[0] = '\0'; /* Find a name. Fetch out configuration first. */ req = gctl_get_handle(); gctl_ro_param(req, "class", -1, "VINUM"); gctl_ro_param(req, "verb", -1, "getconfig"); gctl_ro_param(req, "comment", -1, comment); - gctl_rw_param(req, "config", sizeof(buf), buf); + gctl_add_param(req, "config", sizeof(buf), buf, + GCTL_PARAM_WR | GCTL_PARAM_ASCII); errstr = gctl_issue(req); if (errstr != NULL) { warnx("can't get configuration: %s", errstr); @@ -841,13 +843,16 @@ gvinum_list(int argc, char * const *argv) } + config[0] = '\0'; + req = gctl_get_handle(); gctl_ro_param(req, "class", -1, "VINUM"); gctl_ro_param(req, "verb", -1, "list"); gctl_ro_param(req, "cmd", -1, cmd); gctl_ro_param(req, "argc", sizeof(int), &argc); gctl_ro_param(req, "flags", sizeof(int), &flags); - gctl_rw_param(req, "config", sizeof(config), config); + gctl_add_param(req, "config", sizeof(config), config, + GCTL_PARAM_WR | GCTL_PARAM_ASCII); if (argc) { for (i = 0; i < argc; i++) { snprintf(buf, sizeof(buf), "argv%d", i); @@ -1418,15 +1423,17 @@ printconfig(FILE *of, const char *comment) const char *errstr; time_t now; char buf[GV_CFG_LEN + 1]; - + uname(&uname_s); time(&now); + buf[0] = '\0'; req = gctl_get_handle(); gctl_ro_param(req, "class", -1, "VINUM"); gctl_ro_param(req, "verb", -1, "getconfig"); gctl_ro_param(req, "comment", -1, comment); - gctl_rw_param(req, "config", sizeof(buf), buf); + gctl_add_param(req, "config", sizeof(buf), buf, + GCTL_PARAM_WR | GCTL_PARAM_ASCII); errstr = gctl_issue(req); if (errstr != NULL) { warnx("can't get configuration: %s", errstr); |