1: /* $Header$ */
   2: 
   3: /*
   4:  * Author: Peter J. Nicklin
   5:  */
   6: 
   7: /*
   8:  * diff() compares files and directories via the diff(1) command. Argv is a
   9:  * pointer to an an array of character strings which contain the names of
  10:  * the files and/or directories plus flags for diff. The last argument
  11:  * must be a null pointer. Returns 0 if no differences, 1 if some, 2 if
  12:  * trouble.
  13:  */
  14: #include <sys/param.h>
  15: #include "bin.h"
  16: #include "system.h"
  17: 
  18: diff(argv)
  19:     char **argv;
  20: {
  21:     int pid;            /* process identity */
  22:     int status;         /* child return status */
  23:     int w;              /* a child id */
  24: 
  25:     if ((pid = FORK()) == 0)
  26:         {
  27:         execv(DIFF, argv);
  28:         _exit(2);
  29:         }
  30:     while ((w = wait(&status)) != pid && w != -1)
  31:         continue;
  32:     status >>= NBBY;
  33:     status &=  0xff;
  34:     return(status);
  35: }

Defined functions

diff defined in line 18; never used
Last modified: 1985-07-03
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 459
Valid CSS Valid XHTML 1.0 Strict