1: #ifndef lint
   2: static  char    sccs_id []  = "@(#)submit.c	1.9	5/5/81";
   3: #endif
   4: #include    <ctype.h>
   5: #include    <signal.h>
   6: 
   7: extern  errno;
   8: 
   9: main(ac, av)
  10: register    char **av;
  11: {
  12:     register i, pid;
  13: 
  14:     signal (SIGINT, SIG_IGN);
  15:     signal (SIGQUIT, SIG_IGN);
  16: 
  17:     switch (fork ())    {
  18: 
  19:         case -1:
  20:             error (*av);
  21: 
  22:         case 0:
  23:             --ac, ++av;
  24:             if (!strcmp ("-p", *av) || isnumber(*av) )  {
  25:                 if (**av == '-') { av++; ac--; }
  26:                 while (ac--)
  27:                     if (submit (pid = atoi (*av++)) == -1)
  28:                         perror (*av);
  29:                     else    renice (pid, 10);
  30:                 exit (errno);
  31:                 }
  32:             else    if (submit (getpid ()) == -1)
  33:                     error ("submit");
  34:                 else    nice (10);
  35: 
  36:             if (!strcmp ("-c", *av))    {
  37:                 execl ("/bin/csh", "csh", "-c", *++av, 0);
  38:                 error ("csh");
  39:                 }
  40:             else    {
  41:                 execvp (*av, av);
  42:                 error (*av);
  43:                 }
  44: 
  45:         default:
  46:             exit (0);
  47:     }
  48: }
  49: 
  50: isnumber(s)
  51: register char   *s;
  52: {
  53:     while (*s)
  54:         if (!isdigit(*s++))
  55:             return(0);
  56:     return(1);
  57: }
  58: 
  59: error (s)
  60: register    char    *s;
  61: {
  62:     perror (s);
  63:     exit (errno);
  64: }

Defined functions

error defined in line 59; used 4 times
isnumber defined in line 50; used 1 times
  • in line 24
main defined in line 9; never used

Defined variables

sccs_id defined in line 2; never used
Last modified: 1982-12-11
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 748
Valid CSS Valid XHTML 1.0 Strict