1: #ifndef lint
   2: static char sccsid[] = "@(#)wrapup.c	4.3	(Berkeley)	5/15/86";
   3: #endif not lint
   4: 
   5: #include "signal.h"
   6: #include "stdio.h"
   7: #include "lrnref.h"
   8: 
   9: extern char learnrc[];
  10: 
  11: wrapup(n)
  12: int n;
  13: {
  14:     FILE *fp;
  15: /* this routine does not use 'system' because it wants interrupts turned off */
  16: 
  17:     signal(SIGINT, SIG_IGN);
  18:     chdir("..");
  19:     if (fork() == 0) {
  20:         signal(SIGHUP, SIG_IGN);
  21: #if BSD4_2
  22:         if (fork() == 0) {
  23:             close(1);
  24:             open("/dev/tty", 1);
  25:             execl("/bin/stty", "stty", "new", 0);
  26:         }
  27: #endif
  28:         execl("/bin/rm", "rm", "-rf", dir, 0);
  29:         execl("/usr/bin/rm", "rm", "-rf", dir, 0);
  30:         perror("bin/rm");
  31:         fprintf(stderr, "Wrapup:  can't find 'rm' command.\n");
  32:         exit(0);
  33:     }
  34:     if (n == -1)
  35:         unlink(learnrc);
  36:     else if (!n && todo) {
  37:         if ((fp=fopen(learnrc, "w")) == NULL)
  38:             exit(0);
  39:         fprintf(fp, "%s %s %d\n", sname, todo, speed);
  40:         fclose(fp);
  41:     }
  42:     printf("Bye.\n");   /* not only does this reassure user but it
  43: 				stalls for time while deleting directory */
  44:     fflush(stdout);
  45:     wait(0);
  46:     exit(n);
  47: }

Defined functions

Defined variables

sccsid defined in line 2; never used
Last modified: 1986-05-16
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 672
Valid CSS Valid XHTML 1.0 Strict