diff options
author | dzwdz | 2022-07-17 20:28:53 +0200 |
---|---|---|
committer | dzwdz | 2022-07-17 20:28:53 +0200 |
commit | c6bbf615e5c77ec273b954c11cef95df3d6f7286 (patch) | |
tree | 7b4539c9c5089a8b563d90444c388169fd093cf0 /src/kernel/pipe.c | |
parent | 51cbabd0f40b041fa00203266afa046d14e88b22 (diff) |
kernel/virt_cpy: error struct, better error handling
Diffstat (limited to 'src/kernel/pipe.c')
-rw-r--r-- | src/kernel/pipe.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/kernel/pipe.c b/src/kernel/pipe.c index edd1388..2dc98fe 100644 --- a/src/kernel/pipe.c +++ b/src/kernel/pipe.c @@ -27,6 +27,7 @@ bool pipe_joinqueue(struct handle *h, bool wants_write, void pipe_trytransfer(struct handle *h) { struct process *rdr, *wtr; + struct virt_cpy_error cpyerr; int len; assert(h); if (!h->pipe.sister) { @@ -43,12 +44,12 @@ void pipe_trytransfer(struct handle *h) { len = min(rdr->waits4pipe.len, wtr->waits4pipe.len); - if (!virt_cpy( + virt_cpy( rdr->pages, rdr->waits4pipe.buf, - wtr->pages, wtr->waits4pipe.buf, len)) - { + wtr->pages, wtr->waits4pipe.buf, + len, &cpyerr); + if (cpyerr.read_fail || cpyerr.write_fail) panic_unimplemented(); - } h->pipe.queued = h->pipe.queued->waits4pipe.next; h->pipe.sister->pipe.queued = h->pipe.sister->pipe.queued->waits4pipe.next; process_transition(rdr, PS_RUNNING); |