From owner-p4-projects@FreeBSD.ORG Sat Aug 2 20:39:51 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A7AD81065673; Sat, 2 Aug 2008 20:39:51 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C2531065671 for ; Sat, 2 Aug 2008 20:39:51 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.155]) by mx1.freebsd.org (Postfix) with ESMTP id EDA268FC18 for ; Sat, 2 Aug 2008 20:39:50 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so1940658fgb.35 for ; Sat, 02 Aug 2008 13:39:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=ww7BvYVDblElJU3YVknKvya0GgBbI+3WrC3IcmE5fPo=; b=OAQhnkFNf+n/x1RgQ/9NqT2x31g0EB5mS2QLe63ZbrrPHbZ7IGC+ytrmwxEBIslkWI AyFoReV+bpCXl0qPJPOWOURZ2gkx+m/TnktNaIDZmWR26airPvQ/6axVcu8lTRv/6b5K hy6JycGmNdqxb42TwmMc+gCwOJqK4/B+UmZ/k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=FlyfZXohcImgowsYvZ1M7UctSJgdlOChifnL+9tNr0D9iIuYa9ayItryl7OQz+rJbI ZSAtGJpRgfzhHAKSyTN7RwOtIu2NSs888MjM7dEozu5xqDzfNua/q4yCpJz5yIlnRU6E QaUfd1RmDZwk4o4KLid6MmN8rNhS7liRjcLWw= Received: by 10.86.49.13 with SMTP id w13mr208845fgw.76.1217708138788; Sat, 02 Aug 2008 13:15:38 -0700 (PDT) Received: by 10.86.98.20 with HTTP; Sat, 2 Aug 2008 13:15:38 -0700 (PDT) Message-ID: <364299f40808021315m7fcb67d4pf2ef3bc4612f9f1d@mail.gmail.com> Date: Sat, 2 Aug 2008 13:15:38 -0700 From: "Garrett Cooper" To: "Tim Kientzle" In-Reply-To: <4894AC63.8070403@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200807311508.m6VF8QUD097494@repoman.freebsd.org> <4894AC63.8070403@freebsd.org> Cc: Anselm Strauss , Perforce Change Reviews Subject: Re: PERFORCE change 146324 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Aug 2008 20:39:51 -0000 On Sat, Aug 2, 2008 at 11:50 AM, Tim Kientzle wrote: > Anselm Strauss wrote: >> >> http://perforce.freebsd.org/chv.cgi?CH=146324 > >> ret = (a->compressor.write)(a, &h, sizeof(h)); >> - if (ret != ARCHIVE_OK) return (ARCHIVE_FATAL); >> + if (ret != ARCHIVE_OK) { >> + archive_set_error(&a->archive, EIO, "Can't write local >> file header"); >> + return (ARCHIVE_FATAL); >> + } > > compressor.write should have already set an error > code and message if it's returning an error. > So this isn't needed. (In fact, it's a bad > idea. The writer knows more about the cause > of the error, and by overwriting the error message, > you're just losing useful information. It's > much more useful, for example, to see "Disk full" > or "read-only filesystem" than to see "can't > write Zip header.") Unless you want to do something like: "Can't write Zip header.\nReason:\n%s", strerror(errno) to trace down the failure point? Does archive_set_error use err*(3)? If so it makes my above comment moot... -Garrett