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/ccdconfig/ccdconfig.c | |
parent | 01b9c48b5dec8d4a1161e0592f04b3301c81a1f8 (diff) | |
download | src-2117cdd4b4ebda7db0270c56f5a3cbdd37ec8cfc.tar.gz src-2117cdd4b4ebda7db0270c56f5a3cbdd37ec8cfc.zip |
GEOM: Introduce gctl_add_param() API.
Make gctl_add_param() API public, allowing more precise control over
parameter flags. Previously it was impossible to properly declare
write-only ASCII parameters, used for result reporting, they were
declared as read-write binary instead, that was not nice.
MFC after: 1 month
Diffstat (limited to 'sbin/ccdconfig/ccdconfig.c')
-rw-r--r-- | sbin/ccdconfig/ccdconfig.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sbin/ccdconfig/ccdconfig.c b/sbin/ccdconfig/ccdconfig.c index 6d22b14deed8..1429426e8638 100644 --- a/sbin/ccdconfig/ccdconfig.c +++ b/sbin/ccdconfig/ccdconfig.c @@ -263,7 +263,9 @@ do_single(int argc, char **argv, int action) cp += strlen(_PATH_DEV); gctl_ro_param(grq, buf1, -1, cp); } - gctl_rw_param(grq, "output", sizeof(buf1), buf1); + buf1[0] = '\0'; + gctl_add_param(grq, "output", sizeof(buf1), buf1, + GCTL_PARAM_WR | GCTL_PARAM_ASCII); errstr = gctl_issue(grq); if (errstr == NULL) { if (verbose) { @@ -371,10 +373,12 @@ dumpout(int unit) grq = gctl_get_handle(); ncp = 65536; cp = malloc(ncp); + cp[0] = '\0'; gctl_ro_param(grq, "verb", -1, "list"); gctl_ro_param(grq, "class", -1, "CCD"); gctl_ro_param(grq, "unit", sizeof(unit), &unit); - gctl_rw_param(grq, "output", ncp, cp); + gctl_add_param(grq, "output", ncp, cp, + GCTL_PARAM_WR | GCTL_PARAM_ASCII); errstr = gctl_issue(grq); if (errstr != NULL) errx(1, "%s\nor possibly kernel and ccdconfig out of sync", |