#include <u.h>
#include <libc.h>
-int cpid;
-
void
usage(void)
{
- fprint(2,"usage: alarm time path arg ...\n");
+ fprint(2,"usage: %s time command [ arg ... ]\n", argv0);
exits("usage");
}
static void
catch(void *, char *msg)
{
- postnote(PNGROUP, cpid, msg);
+ postnote(PNGROUP, getpid(), msg);
noted(NDFLT);
}
Waitmsg *w;
long n, t;
+ argv0 = argv[0];
if(argc < 3)
usage();
n = strtol(argv[1], &p, 10);
}
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 */