alarm: make alarm work for processes running as none

This commit is contained in:
cinap_lenrek 2012-03-05 18:30:46 +01:00
parent 88ef1b67b0
commit 532ac0ec66

View file

@ -24,8 +24,6 @@
#include <u.h>
#include <libc.h>
int cpid;
void
usage(void)
{
@ -36,7 +34,7 @@ usage(void)
static void
catch(void *, char *msg)
{
postnote(PNGROUP, cpid, msg);
postnote(PNGROUP, getpid(), msg);
noted(NDFLT);
}
@ -71,7 +69,8 @@ main(int argc, char *argv[])
}
t += n;
}
switch((cpid = rfork(RFFDG|RFREND|RFPROC|RFMEM|RFNOTEG))){
rfork(RFNOTEG);
switch(rfork(RFFDG|RFREND|RFPROC|RFMEM)){
case -1:
sysfatal("%r");
case 0: /* child */