From d85b360627db8025b03cde89ff48149043aaf95c Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Wed, 24 Mar 1993 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1993-03-24 --- port/devpipe.c | 2 +- port/sysproc.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/port/devpipe.c b/port/devpipe.c index 70e60f7a0e82df132a93baa4e2bcb76a8902f7e3..a836c111ec183286a497837ae88f0fa0ed03e0bf 100644 --- a/port/devpipe.c +++ b/port/devpipe.c @@ -170,7 +170,7 @@ pipeopen(Chan *c, int omode) qunlock(p); poperror(); - c->mode = omode&~OTRUNC; + c->mode = openmode(omode); c->flag |= COPEN; c->offset = 0; return c; diff --git a/port/sysproc.c b/port/sysproc.c index f3e7413399576a9f4c5a4f9c4bf5a7e6748ec18c..3c763f9ab594dfb4032c88db444fbf094de7ab3f 100644 --- a/port/sysproc.c +++ b/port/sysproc.c @@ -512,9 +512,12 @@ sysdeath(ulong *arg) long syserrstr(ulong *arg) { + char tmp[ERRLEN]; + validaddr(arg[0], ERRLEN, 1); + memmove(tmp, (char*)arg[0], ERRLEN); memmove((char*)arg[0], u->error, ERRLEN); - strncpy(u->error, Enoerror, ERRLEN); + memmove(u->error, tmp, ERRLEN); return 0; }