Date: Fri, 8 Aug 2008 11:48:45 GMT From: Anselm Strauss <strauss@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 146908 for review Message-ID: <200808081148.m78Bmjew047914@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=146908 Change 146908 by strauss@strauss_marvelman on 2008/08/08 11:47:58 - Removed archive error setting when compressor fails - Comment updates Affected files ... .. //depot/projects/soc2008/strauss_libarchive/libarchive/archive_write_set_format_zip.c#24 edit Differences ... ==== //depot/projects/soc2008/strauss_libarchive/libarchive/archive_write_set_format_zip.c#24 (text+ko) ==== @@ -6,8 +6,8 @@ * - No compression support. * - No encryption support. * - No ZIP64 support. - * - Central directory is missing. * - No support for splitting and spanning. + * - Only writes regular file entries. * * Note that generally data in ZIP files is little-endian encoded, * with some exceptions. @@ -198,7 +198,7 @@ * - compression: Not yet supported (TODO) * - timedate: Means standard input (TODO) * - crc32, compressed_size, uncompressed_size: written in data descriptor - * - extra_length: first used when + * - extra_length: not used (TODO) */ memset(&h, 0, sizeof(h)); zip_encode(ZIP_SIGNATURE_LOCAL_FILE_HEADER, &h.signature, sizeof(h.signature)); @@ -212,17 +212,15 @@ zip_encode(size, &d->uncompressed_size, sizeof(d->uncompressed_size)); ret = (a->compressor.write)(a, &h, sizeof(h)); - if (ret != ARCHIVE_OK) { - archive_set_error(&a->archive, EIO, "Can't write local file header"); + if (ret != ARCHIVE_OK) return (ARCHIVE_FATAL); - } + zip->written_bytes += sizeof(h); ret = (a->compressor.write)(a, path, strlen(path)); - if (ret != ARCHIVE_OK) { - archive_set_error(&a->archive, EIO, "Can't write path field"); + if (ret != ARCHIVE_OK) return (ARCHIVE_FATAL); - } + zip->written_bytes += strlen(path); return (ARCHIVE_OK); @@ -241,7 +239,6 @@ l->crc32 = crc32(l->crc32, buff, s); return s; } else { - archive_set_error(&a->archive, EIO, "Error while writing ZIP data"); return (ret); } } @@ -259,10 +256,8 @@ zip_encode(l->crc32, &d->crc32, sizeof(d->crc32)); ret = (a->compressor.write)(a, d, sizeof(*d)); - if (ret != ARCHIVE_OK) { - archive_set_error(&a->archive, EIO, "Can't write data descriptor"); + if (ret != ARCHIVE_OK) return (ARCHIVE_FATAL); - } zip->written_bytes += sizeof(*d); return (ARCHIVE_OK); @@ -314,18 +309,14 @@ /* Writing file header. */ ret = (a->compressor.write)(a, &h, sizeof(h)); - if (ret != ARCHIVE_OK) { - archive_set_error(&a->archive, EIO, "Can't write file header"); + if (ret != ARCHIVE_OK) return (ARCHIVE_FATAL); - } zip->written_bytes += sizeof(h); /* Writing filename. */ ret = (a->compressor.write)(a, path, strlen(path)); - if (ret != ARCHIVE_OK) { - archive_set_error(&a->archive, EIO, "Can't write path field"); + if (ret != ARCHIVE_OK) return (ARCHIVE_FATAL); - } zip->written_bytes += strlen(path); l = l->next; @@ -343,10 +334,8 @@ /* Writing end of central directory. */ ret = (a->compressor.write)(a, &end, sizeof(end)); - if (ret != ARCHIVE_OK) { - archive_set_error(&a->archive, EIO, "Can't write end of central directory"); + if (ret != ARCHIVE_OK) return (ARCHIVE_FATAL); - } zip->written_bytes += sizeof(end); return (ARCHIVE_OK);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200808081148.m78Bmjew047914>