summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ctm
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1995-03-19 13:42:54 +0000
committerjoerg <joerg@FreeBSD.org>1995-03-19 13:42:54 +0000
commit44a74c37dfde880e660f9b42b2434491efe1daad (patch)
treea2b204f225b8b435e28cc8e0ef10290db8c4ac6d /usr.sbin/ctm
parentaf609f7535ddcbbafd6a069a0b14bae5053e69d5 (diff)
downloadFreeBSD-src-44a74c37dfde880e660f9b42b2434491efe1daad.zip
FreeBSD-src-44a74c37dfde880e660f9b42b2434491efe1daad.tar.gz
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.
Diffstat (limited to 'usr.sbin/ctm')
-rw-r--r--usr.sbin/ctm/ctm/ctm.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.sbin/ctm/ctm/ctm.c b/usr.sbin/ctm/ctm/ctm.c
index b1790a5..99f02df 100644
--- a/usr.sbin/ctm/ctm/ctm.c
+++ b/usr.sbin/ctm/ctm/ctm.c
@@ -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 {
OpenPOWER on IntegriCloud