BSD 4_1c_2 release
[unix-history] / usr / src / usr.bin / learn / wrapup.c
CommitLineData
824a5222 1#ifndef lint
e804469b 2static char sccsid[] = "@(#)wrapup.c 4.1 (Berkeley) 2/24/83";
824a5222
KM
3#endif not lint
4
5#include "signal.h"
6#include "stdio.h"
7#include "lrnref.h"
8
9wrapup(n)
10int n;
11{
12 /* this routine does not use 'system' because it wants
13 interrupts turned off */
14 int retval, pid, pidw;
15
16 signal(SIGINT, SIG_IGN);
17 chdir("..");
18 if ( (pid=fork()) ==0) {
19 signal(SIGHUP, SIG_IGN);
20 execl("/bin/rm", "rm", "-r", dir, 0);
21 execl("/usr/bin/rm", "rm", "-r", dir, 0);
22 fprintf(stderr, "Can't find 'rm' command.\n");
23 exit(0);
24 }
25 printf("Bye.\n"); /* not only does this reassure user but
26 it stalls for time while deleting directory */
27 fflush(stdout);
28 /* printf("Wantd %d got %d val %d\n",pid, pidw, retval); */
29 exit(n);
30}