From 2c4a77f21fea98bcc1edd0bb69f74cf80060c027 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Wed, 7 Nov 2012 18:57:02 +0100 Subject: [PATCH] devproc: remove pgrpid == 1 check for notepg open assuming that this check tried to prevent the hostowner from killing init, it is silly because init would just handle the note. with kbdfs, we actually want to send interrupt note to the initial process group so instead of working arround this with rfork(RFNOTEG|RFNAMEG), we remove the check. --- sys/src/9/boot/bootrc | 10 ++++------ sys/src/9/port/devproc.c | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/sys/src/9/boot/bootrc b/sys/src/9/boot/bootrc index d6c1aa512..e362f815a 100644 --- a/sys/src/9/boot/bootrc +++ b/sys/src/9/boot/bootrc @@ -25,6 +25,10 @@ for(i in `{ls -Qp '#ec'}){ } } +fn sigint { + status=interrupted +} + fn fatal { echo $* exit $"* @@ -154,12 +158,6 @@ fn main{ # keyboard and serial console if(test -x /bin/aux/kbdfs){ - # make new pgrp different from 1 so kbdfs can open notepg - rfork ns - - # ignore interrupts - fn sigint {status=interrupted} - a=$console(1) if(! ~ $#a 0) a=/dev/eia^$a diff --git a/sys/src/9/port/devproc.c b/sys/src/9/port/devproc.c index 16cff7d8e..f963c779d 100644 --- a/sys/src/9/port/devproc.c +++ b/sys/src/9/port/devproc.c @@ -439,7 +439,7 @@ procopen(Chan *c, int omode) pg = p->pgrp; if(pg == nil) error(Eprocdied); - if(omode!=OWRITE || pg->pgrpid == 1) + if(omode!=OWRITE) error(Eperm); c->pgrpid.path = pg->pgrpid+1; c->pgrpid.vers = p->noteid;