From owner-freebsd-bugs Mon Mar 6 00:30:02 1995 Return-Path: bugs-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id AAA26153 for bugs-outgoing; Mon, 6 Mar 1995 00:30:02 -0800 Received: (from gnats@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id AAA26146; Mon, 6 Mar 1995 00:30:02 -0800 Date: Mon, 6 Mar 1995 00:30:02 -0800 Message-Id: <199503060830.AAA26146@freefall.cdrom.com> From: J Wunsch Reply-To: J Wunsch To: freebsd-bugs Subject: misc/233: CTM sometimes does not fully clean up internally In-Reply-To: Your message of Mon, 6 Mar 1995 09:15:22 +0100 <199503060815.JAA04706@uriah.heep.sax.de> Sender: bugs-owner@FreeBSD.org Precedence: bulk >Number: 233 >Category: misc >Synopsis: CTM sometimes does not fully clean up internally >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs (FreeBSD bugs mailing list) >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Mar 6 00:30:01 1995 >Originator: J Wunsch >Organization: >Release: FreeBSD 2.1.0-Development i386 >Environment: >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. >How-To-Repeat: Run ctm(1) with a reasonable number of .gz input deltas and the default maxproc limit of 40. >Fix: Index: ctm.c =================================================================== RCS file: /usr/home/cvs/src/usr.sbin/ctm/ctm/ctm.c,v retrieving revision 1.8 diff -u -r1.8 ctm.c --- 1.8 1995/03/04 20:36:45 +++ ctm.c 1995/03/06 08:05:30 @@ -164,8 +164,8 @@ 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 @@ 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 { >Audit-Trail: >Unformatted: