Finally applying my own fix. :-)

>Description:

ctm(1) sometimes did not free up all used resources (open pipes and
processes, heap memory).  This happened whenever one of the passes
ended prematurely, and it became very apparent when running it on
a bunch of already applied deltas, resulting in a ``gunzip: resource
temporarily unavailable'' due to the maxproc # exhausted.
This commit is contained in:
Joerg Wunsch 1995-03-19 13:42:54 +00:00
parent cb0b0e16cd
commit b2fbeb9a91
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=7168

View File

@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
* $Id: ctm.c,v 1.7 1994/12/01 21:05:28 phk Exp $
* $Id: ctm.c,v 1.8 1995/03/04 20:36:45 phk Exp $
*
* This is the client program of 'CTM'. It will apply a CTM-patch to a
* collection of files.
@ -164,8 +164,8 @@ Proc(char *filename, unsigned applied)
if(!p)
rewind(f);
if((i=Pass1(f, applied)))
return i;
if((i=Pass1(f, applied)))
goto exit_and_close;
if(!p) {
rewind(f);
@ -187,16 +187,18 @@ Proc(char *filename, unsigned applied)
if(i) {
if((!Force) || (i & ~Exit_Forcible))
return i;
goto exit_and_close;
}
if(CheckIt) {
fprintf(stderr,"All checks out ok.\n");
return Exit_Done;
i = Exit_Done;
goto exit_and_close;
}
i=Pass3(f);
exit_and_close:
if(!p) {
fclose(f);
} else {