summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-01-03 01:14:07 +0100
committerFelix Fietkau <nbd@openwrt.org>2013-01-03 01:14:07 +0100
commitfbfd773aa6f77391d5ea6e2ffef8eb9ad6bb7d1e (patch)
tree0f79bdf2adac24e7b093d8747d8a26c8151c0411 /proc.c
parent190ee6ac443d2ab65f62fffb3cb2b48a12e97ea5 (diff)
cleanup dispatch struct access
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/proc.c b/proc.c
index a4c919a..b54e71e 100644
--- a/proc.c
+++ b/proc.c
@@ -224,12 +224,13 @@ static void proc_free(struct client *cl)
bool uh_create_process(struct client *cl, struct path_info *pi,
void (*cb)(struct client *cl, struct path_info *pi, int fd))
{
+ struct dispatch *d = &cl->dispatch;
int fds[2];
int pid;
blob_buf_init(&cl->dispatch.proc.hdr, 0);
- cl->dispatch.proc.status_code = 200;
- cl->dispatch.proc.status_msg = "OK";
+ d->proc.status_code = 200;
+ d->proc.status_msg = "OK";
if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds))
return false;
@@ -250,11 +251,11 @@ bool uh_create_process(struct client *cl, struct path_info *pi,
close(fds[1]);
uh_relay_open(cl, &cl->dispatch.proc.r, fds[0], pid);
- cl->dispatch.free = proc_free;
- cl->dispatch.close_fds = proc_close_fds;
- cl->dispatch.proc.r.header_cb = proc_handle_header;
- cl->dispatch.proc.r.header_end = proc_handle_header_end;
- cl->dispatch.proc.r.close = proc_handle_close;
+ d->free = proc_free;
+ d->close_fds = proc_close_fds;
+ d->proc.r.header_cb = proc_handle_header;
+ d->proc.r.header_end = proc_handle_header_end;
+ d->proc.r.close = proc_handle_close;
return true;
}