vstrerror has been renamed to VAS_errtxt

parent 63843ecb
......@@ -147,7 +147,7 @@ mk_pipe(int fds[2], char *name, struct vsl_log *vsl)
errno = 0;
if (pipe(fds) != 0) {
VSLb(vsl, SLT_Error, "vdfp_pipe: vdp %s: pipe(2) failed: %s",
name, vstrerror(errno));
name, VAS_errtxt(errno));
return (-1);
}
return (0);
......@@ -159,7 +159,7 @@ mk_dup(int oldfd, int newfd)
errno = 0;
if (dup2(oldfd, newfd) == -1) {
fprintf(stderr, "dup2(2) failed for %s: %s", stream_name[newfd],
vstrerror(errno));
VAS_errtxt(errno));
return (-1);
}
return (0);
......@@ -203,14 +203,14 @@ vdp_init(struct vdp_ctx *ctx, void **priv, struct objcore *objcore)
ALLOC_OBJ(state, PIPE_VDP_STATE_MAGIC);
if (state == NULL) {
VSLb(ctx->vsl, SLT_Error, "vdfp_pipe: vdp %s: cannot allocate "
"state: %s", obj->name, vstrerror(errno));
"state: %s", obj->name, VAS_errtxt(errno));
return (-1);
}
state->buf = malloc(obj->bufsz);
if (state->buf == NULL) {
VSLb(ctx->vsl, SLT_Error, "vdfp_pipe: vdp %s: cannot allocate "
"buffer size %zd: %s", obj->name, obj->bufsz,
vstrerror(errno));
VAS_errtxt(errno));
return (-1);
}
*priv = state;
......@@ -250,7 +250,7 @@ vdp_init(struct vdp_ctx *ctx, void **priv, struct objcore *objcore)
state->chldpid = fork();
if (state->chldpid < 0) {
VSLb(ctx->vsl, SLT_Error, "vdfp_pipe: vdp %s: fork failed for "
"%s: %s", obj->name, obj->path, vstrerror(errno));
"%s: %s", obj->name, obj->path, VAS_errtxt(errno));
closefd(&in[0]);
closefd(&in[1]);
closefd(&out[0]);
......@@ -288,7 +288,7 @@ vdp_init(struct vdp_ctx *ctx, void **priv, struct objcore *objcore)
" variable %s=%s: %s",
setenv_entry->var,
setenv_entry->value,
vstrerror(errno));
VAS_errtxt(errno));
exit(EXIT_FAILURE);
}
}
......@@ -296,7 +296,7 @@ vdp_init(struct vdp_ctx *ctx, void **priv, struct objcore *objcore)
errno = 0;
if (execve(obj->path, argv, environ) == -1) {
fprintf(stderr, "cannot exec %s: %s", obj->path,
vstrerror(errno));
VAS_errtxt(errno));
exit(EXIT_FAILURE);
}
}
......@@ -439,7 +439,7 @@ vdp_bytes(struct vdp_ctx *ctx, enum vdp_action act, void **priv,
VSLb(ctx->vsl, SLT_Error,
"vdfp_pipe: vdp %s: error writing "
"to %s stdin: %s", obj->name,
obj->path, vstrerror(errno));
obj->path, VAS_errtxt(errno));
close_all(fds);
return (-1);
}
......@@ -464,7 +464,7 @@ vdp_bytes(struct vdp_ctx *ctx, enum vdp_action act, void **priv,
VSLb(ctx->vsl, SLT_Error, "vdfp_pipe: vdp %s:"
" error reading %s from %s: %s",
obj->name, stream_name[i], obj->path,
vstrerror(errno));
VAS_errtxt(errno));
close_all(fds);
return (-1);
}
......@@ -610,7 +610,7 @@ vmod_vdp__init(VRT_CTX, struct VPFX(pipe_vdp) **vdpp, const char *obj_name,
errno = 0;
if (access(path, X_OK) != 0) {
VDPFAIL(ctx, "new %s: cannot execute %s: %s", obj_name, path,
vstrerror(errno));
VAS_errtxt(errno));
return;
}
if (vdp_name == NULL || *vdp_name == '\0')
......@@ -640,7 +640,7 @@ vmod_vdp__init(VRT_CTX, struct VPFX(pipe_vdp) **vdpp, const char *obj_name,
ALLOC_OBJ(vdp_obj, PIPE_VDP_MAGIC);
if (vdp_obj == NULL) {
VDPFAIL(ctx, "new %s: cannot allocate space for object: %s",
obj_name, vstrerror(errno));
obj_name, VAS_errtxt(errno));
return;
}
*vdpp = vdp_obj;
......@@ -654,7 +654,7 @@ vmod_vdp__init(VRT_CTX, struct VPFX(pipe_vdp) **vdpp, const char *obj_name,
vdp = malloc(sizeof(*vdp));
if (vdp == NULL) {
VDPFAIL(ctx, "new %s: cannot allocate space for VDP: %s",
obj_name, vstrerror(errno));
obj_name, VAS_errtxt(errno));
return;
}
vdp->name = strdup(vdp_name);
......@@ -668,7 +668,7 @@ vmod_vdp__init(VRT_CTX, struct VPFX(pipe_vdp) **vdpp, const char *obj_name,
ALLOC_OBJ(map, PIPE_VDP_MAP_MAGIC);
if (map == NULL) {
VDPFAIL(ctx, "new %s: cannot allocate space for map entry: %s",
obj_name, vstrerror(errno));
obj_name, VAS_errtxt(errno));
return;
}
map->vdp = vdp;
......@@ -680,7 +680,7 @@ vmod_vdp__init(VRT_CTX, struct VPFX(pipe_vdp) **vdpp, const char *obj_name,
vdp_obj->argv = malloc(2 * sizeof(*vdp_obj->argv));
if (vdp_obj->argv == NULL) {
VDPFAIL(ctx, "new %s: cannot allocate argv: %s", obj_name,
vstrerror(errno));
VAS_errtxt(errno));
return;
}
vdp_obj->argv[0] = vdp_obj->path;
......@@ -793,7 +793,7 @@ vmod_vdp_arg(VRT_CTX, struct VPFX(pipe_vdp) *obj, VCL_STRING arg)
(obj->argc + 2) * sizeof(*obj->argv));
if (obj->argv == NULL) {
VDPFAIL(ctx, "%s.arg(): cannot re-allocate argv: %s",
obj->name, vstrerror(errno));
obj->name, VAS_errtxt(errno));
return;
}
obj->argv[obj->argc] = strdup(arg);
......@@ -810,7 +810,7 @@ vmod_vdp_arg(VRT_CTX, struct VPFX(pipe_vdp) *obj, VCL_STRING arg)
task->argv = malloc(3 * sizeof(*task->argv));
if (task->argv == NULL) {
VDPFAIL(ctx, "%s.arg(): cannot allocate argv: %s",
obj->name, vstrerror(errno));
obj->name, VAS_errtxt(errno));
return;
}
if ((task->argv[1] = WS_Copy(ctx->ws, arg, -1)) == NULL) {
......@@ -829,7 +829,7 @@ vmod_vdp_arg(VRT_CTX, struct VPFX(pipe_vdp) *obj, VCL_STRING arg)
(task->argc + 2) * sizeof(*task->argv));
if (task->argv == NULL) {
VDPFAIL(ctx, "%s.arg(): cannot re-allocate argv: %s", obj->name,
vstrerror(errno));
VAS_errtxt(errno));
return;
}
if ((task->argv[task->argc] = WS_Copy(ctx->ws, arg, -1)) == NULL) {
......@@ -881,7 +881,7 @@ vmod_vdp_setenv(VRT_CTX, struct VPFX(pipe_vdp) *obj, VCL_STRING var,
if (obj->setenv_head == NULL) {
VDPFAIL(ctx, "%s.setenv(): cannot allocate "
"list head: %s", obj->name,
vstrerror(errno));
VAS_errtxt(errno));
return;
}
VSTAILQ_INIT(obj->setenv_head);
......@@ -892,7 +892,7 @@ vmod_vdp_setenv(VRT_CTX, struct VPFX(pipe_vdp) *obj, VCL_STRING var,
if (entry == NULL) {
VDPFAIL(ctx,
"%s.setenv(): cannot allocate list entry: %s",
obj->name, vstrerror(errno));
obj->name, VAS_errtxt(errno));
return;
}
......
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