diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2019-09-19 02:07:46 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2019-09-19 02:07:46 +0200 |
commit | 24d1fbde273f30422d852811d3724ede789acd0d (patch) | |
tree | 6ad92031f11ff5ace61c8b8abb492ba9775ad023 /sys/src/9/port/devproc.c | |
parent | f8de863602cfbb957733297cdaa2ee2e19a36f8b (diff) |
kernel: simplify pgrpnote(); moving the note string copying to procwrite()
keeps handling of devproc's note and notepg files similar and in the
same place and reduces stack usage.
Diffstat (limited to 'sys/src/9/port/devproc.c')
-rw-r--r-- | sys/src/9/port/devproc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/src/9/port/devproc.c b/sys/src/9/port/devproc.c index 29b8031c1..699283f5b 100644 --- a/sys/src/9/port/devproc.c +++ b/sys/src/9/port/devproc.c @@ -1164,7 +1164,11 @@ procwrite(Chan *c, void *va, long n, vlong off) * than the process pgrpid */ if(QID(c->qid) == Qnotepg) { - pgrpnote(NOTEID(c->pgrpid), va, n, NUser); + if(n >= ERRMAX-1) + error(Etoobig); + memmove(buf, va, n); + buf[n] = 0; + pgrpnote(NOTEID(c->pgrpid), buf, NUser); return n; } |