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/pgrp.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/pgrp.c')
-rw-r--r-- | sys/src/9/port/pgrp.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/sys/src/9/port/pgrp.c b/sys/src/9/port/pgrp.c index 5de7c695f..190ab7b59 100644 --- a/sys/src/9/port/pgrp.c +++ b/sys/src/9/port/pgrp.c @@ -13,16 +13,10 @@ static Ref pgrpid; static Ref mountid; void -pgrpnote(ulong noteid, char *a, long n, int flag) +pgrpnote(ulong noteid, char *n, int flag) { Proc *p, *ep; - char buf[ERRMAX]; - if(n >= ERRMAX-1) - error(Etoobig); - - memmove(buf, a, n); - buf[n] = 0; p = proctab(0); for(ep = p+conf.nproc; p < ep; p++) { if(p->state == Dead) @@ -30,7 +24,7 @@ pgrpnote(ulong noteid, char *a, long n, int flag) if(up != p && p->noteid == noteid && p->kp == 0) { qlock(&p->debug); if(p->noteid == noteid) - postnote(p, 0, buf, flag); + postnote(p, 0, n, flag); qunlock(&p->debug); } } |