]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
IFC: Pick up some minor corrections from Colin Percival.
authorTim Kientzle <kientzle@gmail.com>
Sat, 24 May 2008 18:40:29 +0000 (14:40 -0400)
committerTim Kientzle <kientzle@gmail.com>
Sat, 24 May 2008 18:40:29 +0000 (14:40 -0400)
SVN-Revision: 89

libarchive/archive_entry_strmode.c
libarchive/archive_read_data_into_fd.c
tar/write.c

index dc08d9721a6c3e0310972ae3124c1c78d0322069..cfe6ae33baa03f4a9188121311bc8acbc89741f1 100644 (file)
@@ -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 <sys/stat.h>
@@ -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)) {
index 664cc2c3c245502729f2b6b723b18f8432c2ed59..3aeef3bc2da8cbd51c3120837c3021ca96fe3825 100644 (file)
@@ -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 <sys/types.h>
@@ -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;
index dcd2fa591d4fd1404c76df38d62c722aefe71237..432612ac7a0ff71c0d60b09e480bf727da4b9c98 100644 (file)
@@ -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 <sys/types.h>