[BACK]Return to patch.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / patch

Diff for /src/usr.bin/patch/patch.c between version 1.2 and 1.3

version 1.2, 1996/06/10 11:21:31 version 1.3, 1996/06/25 23:06:39
Line 784 
Line 784 
 init_output(name)  init_output(name)
 char *name;  char *name;
 {  {
     ofp = fopen(name, "w");      int fd;
     if (ofp == Nullfp)  
       if ((fd = open(name, O_EXCL|O_CREAT|O_RDWR, 0666)) == -1 ||
           (ofp = fdopen(fd, "w")) == NULL) {
           if (fd != -1)
                   close(fd);
         pfatal2("can't create %s", name);          pfatal2("can't create %s", name);
       }
 }  }
   
 /* Open a file to put hunks we can't locate. */  /* Open a file to put hunks we can't locate. */
Line 795 
Line 800 
 init_reject(name)  init_reject(name)
 char *name;  char *name;
 {  {
     rejfp = fopen(name, "w");      int fd;
     if (rejfp == Nullfp)  
       if ((fd = open(name, O_EXCL|O_CREAT|O_RDWR, 0666)) == -1 ||
           (rejfp = fdopen(fd, "w")) == NULL) {
           if (fd != -1)
                   close(fd);
         pfatal2("can't create %s", name);          pfatal2("can't create %s", name);
       }
 }  }
   
 /* Copy input file to output, up to wherever hunk is to be applied. */  /* Copy input file to output, up to wherever hunk is to be applied. */

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3