From owner-svn-src-head@FreeBSD.ORG Thu Mar 5 00:36:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 223D4106564A; Thu, 5 Mar 2009 00:36:14 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EACFF8FC27; Thu, 5 Mar 2009 00:36:13 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n250aDCQ057619; Thu, 5 Mar 2009 00:36:13 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n250aDXc057618; Thu, 5 Mar 2009 00:36:13 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200903050036.n250aDXc057618@svn.freebsd.org> From: Tim Kientzle Date: Thu, 5 Mar 2009 00:36:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189383 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2009 00:36:14 -0000 Author: kientzle Date: Thu Mar 5 00:36:13 2009 New Revision: 189383 URL: http://svn.freebsd.org/changeset/base/189383 Log: Merge r342 from libarchive.googlecode.com: Remove some Windows special casing. Modified: head/lib/libarchive/archive_write_disk.c Modified: head/lib/libarchive/archive_write_disk.c ============================================================================== --- head/lib/libarchive/archive_write_disk.c Thu Mar 5 00:35:21 2009 (r189382) +++ head/lib/libarchive/archive_write_disk.c Thu Mar 5 00:36:13 2009 (r189383) @@ -83,9 +83,6 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_UTIME_H #include #endif -#ifdef _WIN32 -#include -#endif #include "archive.h" #include "archive_string.h" @@ -519,9 +516,6 @@ static ssize_t write_data_block(struct archive_write_disk *a, const char *buff, size_t size) { uint64_t start_size = size; -#if _WIN32 - HANDLE handle; -#endif ssize_t bytes_written = 0; ssize_t block_size = 0, bytes_to_write; @@ -530,9 +524,6 @@ write_data_block(struct archive_write_di "Attempt to write to an empty file"); return (ARCHIVE_WARN); } -#if _WIN32 - handle = (HANDLE)_get_osfhandle(a->fd); -#endif if (a->flags & ARCHIVE_EXTRACT_SPARSE) { #if HAVE_STRUCT_STAT_ST_BLKSIZE @@ -581,26 +572,9 @@ write_data_block(struct archive_write_di if (a->offset + bytes_to_write > block_end) bytes_to_write = block_end - a->offset; } -#ifdef _WIN32 /* Seek if necessary to the specified offset. */ if (offset != a->fd_offset) { - LARGE_INTEGER distance; - distance.QuadPart = offset; - if (!SetFilePointerEx(handle, distance, NULL, FILE_BEGIN)) { - archive_set_error(&a->archive, _dosmaperr(GetLastError()), - "Seek failed"); - return (ARCHIVE_FATAL); - } - } - if (!WriteFile(handle, buff, bytes_to_write, &bytes_written, NULL)) { - archive_set_error(&a->archive, _dosmaperr(GetLastError()), - "Write failed"); - return (ARCHIVE_WARN); - } -#else - /* Seek if necessary to the specified offset. */ - if (a->offset != a->fd_offset) { - if (lseek(a->fd, a->offset, SEEK_SET) < 0) { + if (lseek(a->fd, offset, SEEK_SET) < 0) { archive_set_error(&a->archive, errno, "Seek failed"); return (ARCHIVE_FATAL); @@ -614,7 +588,6 @@ write_data_block(struct archive_write_di archive_set_error(&a->archive, errno, "Write failed"); return (ARCHIVE_WARN); } -#endif buff += bytes_written; size -= bytes_written; a->offset += bytes_written;