From: Tim Kientzle Date: Sat, 24 May 2008 18:40:29 +0000 (-0400) Subject: IFC: Pick up some minor corrections from Colin Percival. X-Git-Tag: v2.6.0~203 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5445f6e7bc5ab6e9a1e73c83dbfacdc181f3af45;p=thirdparty%2Flibarchive.git IFC: Pick up some minor corrections from Colin Percival. SVN-Revision: 89 --- diff --git a/libarchive/archive_entry_strmode.c b/libarchive/archive_entry_strmode.c index dc08d9721..cfe6ae33b 100644 --- a/libarchive/archive_entry_strmode.c +++ b/libarchive/archive_entry_strmode.c @@ -24,7 +24,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry_strmode.c,v 1.2 2008/02/19 05:49:02 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry_strmode.c,v 1.3 2008/05/23 04:57:28 cperciva Exp $"); #ifdef HAVE_SYS_STAT_H #include @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_entry_strmode.c,v 1.2 2008/02/19 const char * archive_entry_strmode(struct archive_entry *entry) { - static const char *perms = "?rwxrwxrwx "; static const mode_t permbits[] = { 0400, 0200, 0100, 0040, 0020, 0010, 0004, 0002, 0001 }; char *bp = entry->strmode; @@ -47,7 +46,7 @@ archive_entry_strmode(struct archive_entry *entry) int i; /* Fill in a default string, then selectively override. */ - strcpy(bp, perms); + strcpy(bp, "?rwxrwxrwx "); mode = archive_entry_mode(entry); switch (archive_entry_filetype(entry)) { diff --git a/libarchive/archive_read_data_into_fd.c b/libarchive/archive_read_data_into_fd.c index 664cc2c3c..3aeef3bc2 100644 --- a/libarchive/archive_read_data_into_fd.c +++ b/libarchive/archive_read_data_into_fd.c @@ -24,7 +24,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_data_into_fd.c,v 1.15 2007/04/02 00:21:46 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_data_into_fd.c,v 1.16 2008/05/23 05:01:29 cperciva Exp $"); #ifdef HAVE_SYS_TYPES_H #include @@ -64,8 +64,12 @@ archive_read_data_into_fd(struct archive *a, int fd) ARCHIVE_OK) { const char *p = buff; if (offset > output_offset) { - lseek(fd, offset - output_offset, SEEK_CUR); - output_offset = offset; + output_offset = lseek(fd, + offset - output_offset, SEEK_CUR); + if (output_offset != offset) { + archive_set_error(a, errno, "Seek error"); + return (ARCHIVE_FATAL); + } } while (size > 0) { bytes_to_write = size; @@ -74,7 +78,7 @@ archive_read_data_into_fd(struct archive *a, int fd) bytes_written = write(fd, p, bytes_to_write); if (bytes_written < 0) { archive_set_error(a, errno, "Write error"); - return (-1); + return (ARCHIVE_FATAL); } output_offset += bytes_written; total_written += bytes_written; diff --git a/tar/write.c b/tar/write.c index dcd2fa591..432612ac7 100644 --- a/tar/write.c +++ b/tar/write.c @@ -24,7 +24,7 @@ */ #include "bsdtar_platform.h" -__FBSDID("$FreeBSD: src/usr.bin/tar/write.c,v 1.68 2008/05/19 18:09:26 cperciva Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/tar/write.c,v 1.69 2008/05/23 05:07:22 cperciva Exp $"); #ifdef HAVE_SYS_TYPES_H #include