From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Mon, 17 Jan 2011 22:39:46 -0500 To: 9fans@9fans.net Message-ID: <8bbc5989dbab94e0b47d3192d4f2048f@chula.quanstro.net> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Subject: [9fans] bad juju in devproc.c Topicbox-Message-UUID: 9e0d1ce0-ead6-11e9-9d60-3106f5b1d025 subtitle: hard linking, chan style. if you do the chan switcheroo, you must close the orphan, too. ; diffy -c devproc.c /n/dump/2011/0117/sys/src/9/port/devproc.c:387,392 - devproc.c:387,393 tc->offset = 0; qunlock(&p->debug); poperror(); + cclose(c); return tc; case Qproc: /n/dump/2011/0117/sys/src/9/port/devproc.c:1183,1190 - devproc.c:1184,1193 error(Eprocdied); } - if(p->pid != PID(c->qid)) + if(p->pid != PID(c->qid)){ + cclose(tc); error(Eprocdied); + } unlock(i); poperror(); it's interesting that the naïve expectation is uniformly that /proc/$pid/text refers to the image cache, not the original opened channel. - erik