Commit ac922674 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Remove the 'type' argument from VSM_Get()

parent 53ca9ec5
......@@ -411,7 +411,7 @@ n_arg_sock(const char *n_arg)
return (-1);
}
if (!VSM_Get(vsm, &vt, "Arg", "-T", "")) {
if (!VSM_Get(vsm, &vt, "Arg", "-T")) {
fprintf(stderr, "No -T arg in shared memory\n");
VSM_Delete(vsm);
return (-1);
......@@ -420,7 +420,7 @@ n_arg_sock(const char *n_arg)
AN(vt.b);
T_start = T_arg = strdup(vt.b);
if (VSM_Get(vsm, &vt, "Arg", "-S", "")) {
if (VSM_Get(vsm, &vt, "Arg", "-S")) {
AZ(VSM_Map(vsm, &vt));
AN(vt.b);
S_arg = strdup(vt.b);
......
......@@ -503,7 +503,7 @@ mgt_cli_secret(const char *S_arg)
char buf[BUFSIZ];
/* Save in shmem */
mgt_SHM_static_alloc(S_arg, strlen(S_arg) + 1L, "Arg", "-S", "");
mgt_SHM_static_alloc(S_arg, strlen(S_arg) + 1L, "Arg", "", "-S");
VJ_master(JAIL_MASTER_FILE);
fd = open(S_arg, O_RDONLY);
......@@ -573,7 +573,7 @@ mgt_cli_telnet(const char *T_arg)
if (VSB_len(vsb) == 0)
ARGV_ERR("-T %s could not be listened on.\n", T_arg);
/* Save in shmem */
mgt_SHM_static_alloc(VSB_data(vsb), VSB_len(vsb) + 1, "Arg", "-T", "");
mgt_SHM_static_alloc(VSB_data(vsb), VSB_len(vsb) + 1, "Arg", "", "-T");
VSB_destroy(&vsb);
}
......
......@@ -196,11 +196,11 @@ const struct vsm_valid *VSM_StillValid(const struct vsm *vd,
*/
int VSM_Get(const struct vsm *vd, struct VSM_fantom *vf,
const char *class, const char *type, const char *ident);
const char *class, const char *ident);
/*
* Find a chunk, produce fantom for it.
* Returns zero on failure.
* class is mandatory, type and ident optional.
* class is mandatory, ident optional.
*/
#endif /* VAPI_VSM_H_INCLUDED */
......@@ -247,7 +247,7 @@ VSL_CursorVSM(struct VSL_data *vsl, struct vsm *vsm, unsigned options)
CHECK_OBJ_NOTNULL(vsl, VSL_MAGIC);
if (!VSM_Get(vsm, &vf, VSL_CLASS, "", "")) {
if (!VSM_Get(vsm, &vf, VSL_CLASS, NULL)) {
(void)vsl_diag(vsl,
"No VSL chunk found (child not started ?)");
return (NULL);
......
......@@ -208,7 +208,7 @@ VSM_Name(const struct vsm *vd)
struct VSM_fantom vt;
CHECK_OBJ_NOTNULL(vd, VSM_MAGIC);
if (VSM_Get(vd, &vt, "Arg", "-i", ""))
if (VSM_Get(vd, &vt, "Arg", "-i"))
return (vt.b);
return ("");
}
......@@ -481,15 +481,13 @@ VSM_StillValid(const struct vsm *vd, struct VSM_fantom *vf)
int
VSM_Get(const struct vsm *vd, struct VSM_fantom *vf,
const char *class, const char *type, const char *ident)
const char *class, const char *ident)
{
CHECK_OBJ_NOTNULL(vd, VSM_MAGIC);
VSM_FOREACH(vf, vd) {
if (strcmp(vf->class, class))
continue;
if (type != NULL && strcmp(vf->type, type))
continue;
if (ident != NULL && strcmp(vf->ident, ident))
continue;
return (1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment