From owner-freebsd-bugs Tue Mar 4 08:29:53 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id IAA29148 for bugs-outgoing; Tue, 4 Mar 1997 08:29:53 -0800 (PST) Received: from scanner.worldgate.com (scanner.worldgate.com [198.161.84.3]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id IAA29141 for ; Tue, 4 Mar 1997 08:29:50 -0800 (PST) Received: from znep.com (uucp@localhost) by scanner.worldgate.com (8.8.5/8.7.3) with UUCP id JAA06766; Tue, 4 Mar 1997 09:29:41 -0700 (MST) Received: from localhost (marcs@localhost) by alive.znep.com (8.7.5/8.7.3) with SMTP id JAA21078; Tue, 4 Mar 1997 09:23:13 -0700 (MST) Date: Tue, 4 Mar 1997 09:23:13 -0700 (MST) From: Marc Slemko To: Garrett Wollman cc: bugs@freebsd.org Subject: Re: bin/2870: fetch won't restart http transfers In-Reply-To: <9703041506.AA26430@halloran-eldar.lcs.mit.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Tue, 4 Mar 1997, Garrett Wollman wrote: > < > > if (to_stdout) > > local = fopen("/dev/stdout", "w"); > > else > > ! local = fopen(fs->fs_outputfile, "a"); > > if (local == 0) { > > warn("%s: fopen", fs->fs_outputfile); > > fclose(remote); > > This is incorrect. The correct code would be: > > if (to_stdout) > local = fopen("/dev/stdout", restarting ? "a" : "w"); > else > local = fopen(fs->fs_outputfile, restarting ? "a" : "w"); I actually thought about it, but: 1. how are we going to append to stdout and what meaning does that have? 2. what does it matter if we open it for appending, since a file opened for appending need not exist and we seek to the start before writing anyway. I won't disagree with only opening for appending if you are restarting, but don't see the necessity... > > The comment immediately above should probably be fixed as well. > > > > ! if (strncasecmp(orig, "bytes", 5) != 0) { > > warnx("unknown Content-Range unit: `%s'", orig); > > return EX_PROTOCOL; > > } > > This patch is correct. I don't know how I missed this. > > -GAWollman >