From phk@critter.dk.tfs.com  Wed Jan 15 02:02:19 1997
Received: from tfs.com (tfs.com [140.145.250.1])
          by freefall.freebsd.org (8.8.4/8.8.4) with SMTP id CAA20021
          for <FreeBSD-gnats-submit@freebsd.org>; Wed, 15 Jan 1997 02:02:18 -0800 (PST)
Received: from schizo.dk.tfs.com by tfs.com (smail3.1.28.1) with SMTP
	id m0vkSAC-0003w7C; Wed, 15 Jan 97 02:01 PST
Received: from critter.dk.tfs.com (critter.dk.tfs.com [140.145.230.252]) by schizo.dk.tfs.com (8.8.2/8.7.3) with ESMTP id LAA10248 for <FreeBSD-gnats-submit@freebsd.org>; Wed, 15 Jan 1997 11:01:37 +0100 (MET)
Received: (from phk@localhost) by critter.dk.tfs.com (8.8.2/8.8.2) id LAA26798; Wed, 15 Jan 1997 11:02:34 +0100 (MET)
Message-Id: <199701151002.LAA26798@critter.dk.tfs.com>
Date: Wed, 15 Jan 1997 11:02:34 +0100 (MET)
From: Poul-Henning Kamp <phk@critter.dk.tfs.com>
Reply-To: phk@critter.dk.tfs.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: fetch ftp://bla bla doesn't bail in disk full.
X-Send-Pr-Version: 3.2

>Number:         2499
>Category:       bin
>Synopsis:       fetch ftp://bla bla doesn't bail in disk full.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    des
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 15 02:10:01 PST 1997
>Closed-Date:    Fri May 21 16:14:00 PDT 1999
>Last-Modified:  Fri May 21 16:15:26 PDT 1999
>Originator:     Poul-Henning Kamp
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
Internation secret Bearded FreeBSD Core members conspiracy.
>Environment:

	fetch ftp://something/big into an almost full filesystem.

>Description:

	it doesn't stop on disk full but leaves a truncated file
	behind.

>How-To-Repeat:

	as above

>Fix:

Maybe:

Warning: cut&pasted patch

# cvs diff -u
cvs diff: Diffing .
Index: main.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/fetch/main.c,v
retrieving revision 1.26.2.2
diff -u -r1.26.2.2 main.c
--- main.c      1996/11/28 08:26:14     1.26.2.2
+++ main.c      1997/01/15 09:38:04
@@ -385,7 +385,7 @@
        display (size, n);
        status = fwrite (buffer, 1, n, file);
        if (status != n)
-           break;
+           die(0);
     }
     timer.it_value.tv_sec = 0;
     timer.it_value.tv_usec = 0;

>Release-Note:
>Audit-Trail:

From: Garrett Wollman <wollman@lcs.mit.edu>
To: phk@critter.dk.tfs.com
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: bin/2499: fetch ftp://bla bla doesn't bail in disk full.
Date: Wed, 15 Jan 1997 11:03:25 -0500

 <<On Wed, 15 Jan 1997 11:02:34 +0100 (MET), Poul-Henning Kamp <phk@critter.dk.tfs.com> said:
 
 > -           break;
 > +           die(0);
 
 Should check ferror(fp) before dying.
 
 -GAWollman
 
 --
 Garrett A. Wollman   | O Siem / We are all family / O Siem / We're all the same
 wollman@lcs.mit.edu  | O Siem / The fires of freedom 
 Opinions not those of| Dance in the burning flame
 MIT, LCS, ANA, or NSA|                     - Susan Aglukark and Chad Irschick
State-Changed-From-To: open->feedback 
State-Changed-By: steve 
State-Changed-When: Sun May 31 13:18:53 PDT 1998 
State-Changed-Why:  
'des' has done quite a bit of rearranging in here since this 
PR was submitted.  Are you still seeing this problem? 
State-Changed-From-To: feedback->open 
State-Changed-By: steve 
State-Changed-When: Mon Jun 1 16:47:41 PDT 1998 
State-Changed-Why:  
Still not fixed. 


Responsible-Changed-From-To: freebsd-bugs->des 
Responsible-Changed-By: steve 
Responsible-Changed-When: Mon Jun 1 16:47:41 PDT 1998 
Responsible-Changed-Why:  
Inline with ongoing effort to cleanup fetch code. 
State-Changed-From-To: open->closed 
State-Changed-By: jmz 
State-Changed-When: Fri May 21 16:14:00 PDT 1999 
State-Changed-Why:  
fixed in -current. 
>Unformatted:
