From owner-freebsd-stable Thu Nov 30 0:59:24 2000 Delivered-To: freebsd-stable@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id 7632537B698; Thu, 30 Nov 2000 00:59:20 -0800 (PST) Received: (from des@localhost) by flood.ping.uio.no (8.9.3/8.9.3) id JAA79407; Thu, 30 Nov 2000 09:59:19 +0100 (CET) (envelope-from des@ofug.org) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: asami@freebsd.org (Satoshi Asami) Cc: stable@freebsd.org Subject: Re: fetch: transfer timed out References: <200011291548.eATFmUN83621@silvia.hip.berkeley.edu> From: Dag-Erling Smorgrav Date: 30 Nov 2000 09:59:19 +0100 In-Reply-To: asami@freebsd.org's message of "Wed, 29 Nov 2000 07:48:30 -0800 (PST)" Message-ID: Lines: 12 User-Agent: Gnus/5.0802 (Gnus v5.8.2) Emacs/20.4 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --=-=-= asami@freebsd.org (Satoshi Asami) writes: > I've noticed a few of these recently. This suggests that fetch is > exiting with zero even though the transfer timed out. Try the attached patch. DES -- Dag-Erling Smorgrav - des@ofug.org --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=timeout.diff Content-Description: timeout patch Index: fetch.c =================================================================== RCS file: /home/ncvs/src/usr.bin/fetch/fetch.c,v retrieving revision 1.10.2.7 diff -u -r1.10.2.7 fetch.c --- fetch.c 2000/09/17 19:51:14 1.10.2.7 +++ fetch.c 2000/11/30 08:48:27 @@ -384,7 +384,7 @@ stat_end(&xs); - /* Set mtime of local file */ + /* set mtime of local file */ if (!n_flag && us.mtime && !o_stdout && (stat(path, &sb) != -1) && sb.st_mode & S_IFREG) { struct timeval tv[2]; @@ -420,6 +420,15 @@ if (us.size != -1 && count < us.size) { warnx("%s appears to be truncated: %lld/%lld bytes", path, count, us.size); + goto failure_keep; + } + + /* + * If the transfer timed out and we didn't know how much to + * expect, assume the worst (i.e. we didn't get all of it) + */ + if (sigalrm && us.size == -1) { + warnx("%s may be truncated", path); goto failure_keep; } --=-=-=-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message