Commit 36e06705 authored by Geoff Simmons's avatar Geoff Simmons

Fix for changed VDP interface.

parent 58fe2f19
...@@ -362,8 +362,8 @@ check_pid(struct vdp_state *state, struct vsl_log *vsl, int options) ...@@ -362,8 +362,8 @@ check_pid(struct vdp_state *state, struct vsl_log *vsl, int options)
} }
static int v_matchproto_(vdp_bytes_f) static int v_matchproto_(vdp_bytes_f)
vdp_bytes(struct req *req, enum vdp_action act, void **priv, const void *ptr, vdp_bytes(struct vdp_ctx *ctx, enum vdp_action act, void **priv,
ssize_t len) const void *ptr, ssize_t len)
{ {
struct vdp_state *state; struct vdp_state *state;
struct pollfd *fds; struct pollfd *fds;
...@@ -371,7 +371,7 @@ vdp_bytes(struct req *req, enum vdp_action act, void **priv, const void *ptr, ...@@ -371,7 +371,7 @@ vdp_bytes(struct req *req, enum vdp_action act, void **priv, const void *ptr,
ssize_t nbytes; ssize_t nbytes;
struct VPFX(pipe_vdp) *obj; struct VPFX(pipe_vdp) *obj;
CHECK_OBJ_NOTNULL(req, REQ_MAGIC); CHECK_OBJ_NOTNULL(ctx, VDP_CTX_MAGIC);
assert(len >= 0); assert(len >= 0);
AN(priv); AN(priv);
CAST_OBJ_NOTNULL(state, *priv, PIPE_VDP_STATE_MAGIC); CAST_OBJ_NOTNULL(state, *priv, PIPE_VDP_STATE_MAGIC);
...@@ -399,7 +399,7 @@ vdp_bytes(struct req *req, enum vdp_action act, void **priv, const void *ptr, ...@@ -399,7 +399,7 @@ vdp_bytes(struct req *req, enum vdp_action act, void **priv, const void *ptr,
if (retval == 0) { if (retval == 0) {
if (obj->tmo_ms == 0) if (obj->tmo_ms == 0)
continue; continue;
VSLb(req->vsl, SLT_Error, "vdfp_pipe: vdp %s: timeout " VSLb(ctx->vsl, SLT_Error, "vdfp_pipe: vdp %s: timeout "
"waiting for %s", obj->name, obj->path); "waiting for %s", obj->name, obj->path);
return (-1); return (-1);
} }
...@@ -409,7 +409,7 @@ vdp_bytes(struct req *req, enum vdp_action act, void **priv, const void *ptr, ...@@ -409,7 +409,7 @@ vdp_bytes(struct req *req, enum vdp_action act, void **priv, const void *ptr,
continue; continue;
AZ(fds[i].revents & POLLNVAL); AZ(fds[i].revents & POLLNVAL);
if (fds[i].revents & POLLERR) { if (fds[i].revents & POLLERR) {
VSLb(req->vsl, SLT_Error, "vdfp_pipe: vdp %s: " VSLb(ctx->vsl, SLT_Error, "vdfp_pipe: vdp %s: "
"error polling %s %s", obj->name, "error polling %s %s", obj->name,
obj->path, stream_name[i]); obj->path, stream_name[i]);
close_all(fds); close_all(fds);
...@@ -427,7 +427,7 @@ vdp_bytes(struct req *req, enum vdp_action act, void **priv, const void *ptr, ...@@ -427,7 +427,7 @@ vdp_bytes(struct req *req, enum vdp_action act, void **priv, const void *ptr,
errno = 0; errno = 0;
nbytes = write(fds[STDIN_FILENO].fd, ptr, len); nbytes = write(fds[STDIN_FILENO].fd, ptr, len);
if (nbytes < 0) { if (nbytes < 0) {
VSLb(req->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, vstrerror(errno));
...@@ -452,7 +452,7 @@ vdp_bytes(struct req *req, enum vdp_action act, void **priv, const void *ptr, ...@@ -452,7 +452,7 @@ vdp_bytes(struct req *req, enum vdp_action act, void **priv, const void *ptr,
errno = 0; errno = 0;
nbytes = read(fds[i].fd, state->buf, obj->bufsz); nbytes = read(fds[i].fd, state->buf, obj->bufsz);
if (nbytes < 0) { if (nbytes < 0) {
VSLb(req->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)); vstrerror(errno));
...@@ -467,7 +467,7 @@ vdp_bytes(struct req *req, enum vdp_action act, void **priv, const void *ptr, ...@@ -467,7 +467,7 @@ vdp_bytes(struct req *req, enum vdp_action act, void **priv, const void *ptr,
continue; continue;
} }
if (i == STDOUT_FILENO) { if (i == STDOUT_FILENO) {
retval = VDP_bytes(req, VDP_FLUSH, state->buf, retval = VDP_bytes(ctx, VDP_FLUSH, state->buf,
nbytes); nbytes);
if (retval < 0) { if (retval < 0) {
close_all(fds); close_all(fds);
...@@ -490,7 +490,7 @@ vdp_bytes(struct req *req, enum vdp_action act, void **priv, const void *ptr, ...@@ -490,7 +490,7 @@ vdp_bytes(struct req *req, enum vdp_action act, void **priv, const void *ptr,
errmsg++; errmsg++;
continue; continue;
} }
VSLb(req->vsl, SLT_Error, VSLb(ctx->vsl, SLT_Error,
"vdfp_pipe: vdp %s: %s stderr: %.*s", "vdfp_pipe: vdp %s: %s stderr: %.*s",
obj->name, obj->path, (int)linelen, obj->name, obj->path, (int)linelen,
errmsg); errmsg);
......
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