vstrerror has been renamed to VAS_errtxt

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