version 1.2, 1996/06/10 11:21:31 |
version 1.3, 1996/06/25 23:06:39 |
|
|
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. */ |
|
|
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. */ |