Date: Sat, 02 Aug 2008 11:50:11 -0700 From: Tim Kientzle <kientzle@freebsd.org> To: Anselm Strauss <strauss@freebsd.org> Cc: Perforce Change Reviews <perforce@freebsd.org> Subject: Re: PERFORCE change 146324 for review Message-ID: <4894AC63.8070403@freebsd.org> In-Reply-To: <200807311508.m6VF8QUD097494@repoman.freebsd.org> References: <200807311508.m6VF8QUD097494@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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.")
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4894AC63.8070403>