alarm: make alarm work for processes running as none
This commit is contained in:
parent
88ef1b67b0
commit
532ac0ec66
1 changed files with 3 additions and 4 deletions
|
@ -24,8 +24,6 @@
|
||||||
#include <u.h>
|
#include <u.h>
|
||||||
#include <libc.h>
|
#include <libc.h>
|
||||||
|
|
||||||
int cpid;
|
|
||||||
|
|
||||||
void
|
void
|
||||||
usage(void)
|
usage(void)
|
||||||
{
|
{
|
||||||
|
@ -36,7 +34,7 @@ usage(void)
|
||||||
static void
|
static void
|
||||||
catch(void *, char *msg)
|
catch(void *, char *msg)
|
||||||
{
|
{
|
||||||
postnote(PNGROUP, cpid, msg);
|
postnote(PNGROUP, getpid(), msg);
|
||||||
noted(NDFLT);
|
noted(NDFLT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +69,8 @@ main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
t += n;
|
t += n;
|
||||||
}
|
}
|
||||||
switch((cpid = rfork(RFFDG|RFREND|RFPROC|RFMEM|RFNOTEG))){
|
rfork(RFNOTEG);
|
||||||
|
switch(rfork(RFFDG|RFREND|RFPROC|RFMEM)){
|
||||||
case -1:
|
case -1:
|
||||||
sysfatal("%r");
|
sysfatal("%r");
|
||||||
case 0: /* child */
|
case 0: /* child */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue