]> git.ipfire.org Git - thirdparty/libarchive.git/log
thirdparty/libarchive.git
15 years agoReduce the likelihood of false hardlinks by ignoring entries with
Tim Kientzle [Tue, 8 Dec 2009 06:18:24 +0000 (01:18 -0500)] 
Reduce the likelihood of false hardlinks by ignoring entries with
nlinks <= 1 when comparing dev/ino values.  This seems to address Issue 54.

SVN-Revision: 1718

15 years agoMerge libarchive 2.7
Brad King [Mon, 7 Dec 2009 00:19:28 +0000 (19:19 -0500)] 
Merge libarchive 2.7

This commit was manufactured during conversion from SVN
to merge the libarchive 2.7 branch.

15 years agoRemove -Werror for production release.
Tim Kientzle [Mon, 7 Dec 2009 00:19:28 +0000 (19:19 -0500)] 
Remove -Werror for production release.

SVN-Revision: 1717

15 years agoCorrect some printf format strings, per Issue 52.
Tim Kientzle [Mon, 7 Dec 2009 00:15:41 +0000 (19:15 -0500)] 
Correct some printf format strings, per Issue 52.

SVN-Revision: 1716

15 years agoFix empty error message reported in Issue 51.
Tim Kientzle [Mon, 7 Dec 2009 00:11:21 +0000 (19:11 -0500)] 
Fix empty error message reported in Issue 51.

SVN-Revision: 1715

15 years agoStyle: Break some long lines.
Tim Kientzle [Sun, 6 Dec 2009 23:52:35 +0000 (18:52 -0500)] 
Style:  Break some long lines.
Also, restructure the index number handling to include a truncation
check.

SVN-Revision: 1714

15 years agoFreeBSD has bsdxml.h
Tim Kientzle [Sun, 6 Dec 2009 23:41:37 +0000 (18:41 -0500)] 
FreeBSD has bsdxml.h

SVN-Revision: 1713

15 years agoExplain the index number validation here.
Tim Kientzle [Sun, 6 Dec 2009 23:41:11 +0000 (18:41 -0500)] 
Explain the index number validation here.

SVN-Revision: 1712

15 years agoEliminate a warning with liblzmadec.
Michihiro NAKAJIMA [Sun, 6 Dec 2009 18:02:49 +0000 (13:02 -0500)] 
Eliminate a warning with liblzmadec.

SVN-Revision: 1711

15 years agoFix typo.
Michihiro NAKAJIMA [Sun, 6 Dec 2009 17:50:04 +0000 (12:50 -0500)] 
Fix typo.

SVN-Revision: 1710

15 years agoRemove unneeded initialization.
Michihiro NAKAJIMA [Sun, 6 Dec 2009 16:21:28 +0000 (11:21 -0500)] 
Remove unneeded initialization.

SVN-Revision: 1709

15 years agoProperly cleanup hardlinked list.
Michihiro NAKAJIMA [Sun, 6 Dec 2009 16:13:31 +0000 (11:13 -0500)] 
Properly cleanup hardlinked list.

SVN-Revision: 1708

15 years agoDo not try finding hardlinked files which are resolved.
Michihiro NAKAJIMA [Sun, 6 Dec 2009 16:00:34 +0000 (11:00 -0500)] 
Do not try finding hardlinked files which are resolved.

SVN-Revision: 1707

15 years agoAdd check of the number of the nlink to an xar test.
Michihiro NAKAJIMA [Sun, 6 Dec 2009 10:15:58 +0000 (05:15 -0500)] 
Add check of the number of the nlink to an xar test.

SVN-Revision: 1706

15 years agoFix several warnings with strict compiling flags.
Michihiro NAKAJIMA [Sun, 6 Dec 2009 10:07:00 +0000 (05:07 -0500)] 
Fix several warnings with strict compiling flags.

Pointed out by Tim Kientzle

SVN-Revision: 1705

15 years agoFurther refine the index number checks for cpio and extend
Tim Kientzle [Sun, 6 Dec 2009 07:36:55 +0000 (02:36 -0500)] 
Further refine the index number checks for cpio and extend
them to newc as well.
This is in preparation for work to generate synthetic index
numbers when writing cpio formats, in order to avoid truncation
problems.

SVN-Revision: 1704

15 years ago1) Empty cpio test uses assertEqualMem() for better error reporting.
Tim Kientzle [Sun, 6 Dec 2009 07:30:32 +0000 (02:30 -0500)] 
1) Empty cpio test uses assertEqualMem() for better error reporting.
2) cpio_odc test permits synthetic ino values:
   * Zero input values must get written as zero
   * Matching non-zero values must get written as matching non-zero values
   * Non-matching non-zero values must get written as non-matching non-zero values

SVN-Revision: 1703

15 years agoIf we're using xml2-config to link libxml2, use it to get
Tim Kientzle [Sat, 5 Dec 2009 19:11:13 +0000 (14:11 -0500)] 
If we're using xml2-config to link libxml2, use it to get
the library requirements as well as cflags.

SVN-Revision: 1700

15 years agoAdd support for xar reader.
Michihiro NAKAJIMA [Fri, 4 Dec 2009 18:01:26 +0000 (13:01 -0500)] 
Add support for xar reader.

SVN-Revision: 1699

15 years agoWhen creationg a hash, a persisted private key is unneeded.
Michihiro NAKAJIMA [Fri, 4 Dec 2009 06:50:32 +0000 (01:50 -0500)] 
When creationg a hash, a persisted private key is unneeded.
This patch avoids a possibility that calling CryptAcquireContext()
cause an accss error.
see also http://support.microsoft.com/kb/238187/en-us/

SVN-Revision: 1698

15 years agoProperly use hash functions on Windows.
Michihiro NAKAJIMA [Thu, 3 Dec 2009 13:51:27 +0000 (08:51 -0500)] 
Properly use hash functions on Windows.

SVN-Revision: 1697

15 years agoCALG_SHA256, CALG_SHA384 and CALG_SHA512 are wrong name.
Michihiro NAKAJIMA [Thu, 3 Dec 2009 12:58:29 +0000 (07:58 -0500)] 
CALG_SHA256, CALG_SHA384 and CALG_SHA512 are wrong name.
Use CALG_SHA_256, CALG_SHA_384 and CALG_SHA_512 instead.

SVN-Revision: 1696

15 years agoRevert previous change of tar/tree.c
Michihiro NAKAJIMA [Thu, 3 Dec 2009 12:39:52 +0000 (07:39 -0500)] 
Revert previous change of tar/tree.c
It's my local hack.

SVN-Revision: 1695

15 years agoAdd archive_hash.h into libarchive/CMakefile.txt
Michihiro NAKAJIMA [Thu, 3 Dec 2009 12:34:11 +0000 (07:34 -0500)] 
Add archive_hash.h into libarchive/CMakefile.txt

SVN-Revision: 1694

15 years agoRemove AC_HEADER_STDC from the autoconf configuration, as
Tim Kientzle [Wed, 2 Dec 2009 08:11:33 +0000 (03:11 -0500)] 
Remove AC_HEADER_STDC from the autoconf configuration, as
it's not actually used anywhere.

Thanks to Brad King for finding this and fixing it in the Cmake build.

SVN-Revision: 1693

15 years agoRemove STDC_HEADERS check from non-autoconf builds
Brad King [Tue, 1 Dec 2009 16:08:04 +0000 (11:08 -0500)] 
Remove STDC_HEADERS check from non-autoconf builds

This autoconf check is used only within its configure tests and is not
used in libarchive source code.  The CMake configuration test used a
try_run(), which prevents cross-compiling without manual specification
of the result.  Since the result of the test is not used anyway we
simply remove it.

SVN-Revision: 1692

15 years agoSupport openssl without SHA-2 hash functions
Brad King [Mon, 30 Nov 2009 15:19:45 +0000 (10:19 -0500)] 
Support openssl without SHA-2 hash functions

Previously we assumed that <openssl/sha.h> provides all the SHA-2 hash
functions if it exists.  Some OpenSSL installations do not, so we need
to test for them at configuration time.  Currently we perform the tests
only for CMake builds.  We preserve the old behavior for the autotools
build by hard-coding availability, and leave a TODO comment for someone
to actually add the checks.

SVN-Revision: 1691

15 years agoFix hash function config tests with CMake
Brad King [Mon, 30 Nov 2009 15:19:36 +0000 (10:19 -0500)] 
Fix hash function config tests with CMake

The commit "Improve portability of MD5/SHA* headers and functions" added
both autotools and CMake detection of MD5, RMD, and SHA* hash functions.
The commit "Move hashing function calling into a separate file" rewrote
the autotools logic and changed the source to use different config
macros but did not update the CMake logic.  This commit updates the
CMake configuration tests to produce the result macros the code expects.

SVN-Revision: 1690

15 years agoSeveral fixes to Windows handling in tree.c:
Tim Kientzle [Mon, 30 Nov 2009 00:46:08 +0000 (19:46 -0500)] 
Several fixes to Windows handling in tree.c:
 * Convert \ to / on entry; this allows us to remove duplicate '/' and '\' checks from a couple of places
 * Rework tree_append() to make it clearer that buff != NULL by the time we get to anything interesting (found by Clang)
 * After appending initial path, set the path length so it doesn't get overwritten

SVN-Revision: 1688

15 years agoFuzz test the rpm unwrapper.
Tim Kientzle [Sun, 29 Nov 2009 23:11:06 +0000 (18:11 -0500)] 
Fuzz test the rpm unwrapper.

SVN-Revision: 1687

15 years agoThe fuzz tester uncovered an infinite loop in the recovery code that
Tim Kientzle [Sun, 29 Nov 2009 23:09:46 +0000 (18:09 -0500)] 
The fuzz tester uncovered an infinite loop in the recovery code that
searches forward for the next undamaged cpio header.  This occurred
when the number of bytes returned by the next read operation happened
to be exactly the size of a cpio header.  In this case, an off-by-one
error caused this code to decide that it didn't have enough bytes to
examine and then to loop around and ask for the exact same bytes again.

SVN-Revision: 1686

15 years agoCast away a compiler warning.
Tim Kientzle [Sun, 29 Nov 2009 23:05:31 +0000 (18:05 -0500)] 
Cast away a compiler warning.

SVN-Revision: 1685

15 years agoFix an embarrassing typo that prevented the display of the expected file contents...
Tim Kientzle [Sun, 29 Nov 2009 20:37:43 +0000 (15:37 -0500)] 
Fix an embarrassing typo that prevented the display of the expected file contents when a file was unexpectedly empty.

SVN-Revision: 1684

15 years agoAdjust this test to verify the convention that tar always stores filenames with ...
Tim Kientzle [Sun, 29 Nov 2009 20:36:32 +0000 (15:36 -0500)] 
Adjust this test to verify the convention that tar always stores filenames with '/' path separators, even on Windows.

SVN-Revision: 1683

15 years agor1679 provides a way to gracefully handle the failure to decompress single ZISOFS...
Tim Kientzle [Sun, 29 Nov 2009 20:35:13 +0000 (15:35 -0500)] 
r1679 provides a way to gracefully handle the failure to decompress single ZISOFS entries; use that to suppress test failures in environments that lack zlib.

SVN-Revision: 1682

15 years ago"Fix" this test on Win32 by suppressing tests of error handling that relies on proper...
Tim Kientzle [Sun, 29 Nov 2009 20:33:21 +0000 (15:33 -0500)] 
"Fix" this test on Win32 by suppressing tests of error handling that relies on proper error detection within archive_entry_update_pathname_utf8().

The core problem here is that Windows has several different APIs for character-set conversion.  These tests rely on the POSIX-standard setlocale() to set the default character set for this process in order to then force character-conversion failures and verify the error-handling.  But the Win32 APIs don't obey setlocale() so this fails.  Indeed, I've found no way to programmatically override the CP_ACP code page for just the current process:  I considered using CP_THREAD_ACP instead but it seems to be broken (or at least there are a lot of bloggers claiming it should never be used).  It doesn't help that Windows documentation confuses "code page" with "language" (SetCurrentLocale() accepts a language code but the documentation claims it sets the code page while offering no insight into how language codes get mapped to code pages---remember that Japanese and Chinese are supported by several code pages).  I've gleaned from various blogs that the default code page cannot be set to UTF-8 in any case due to some bad assumptions deep in Win32's character-conversion routines (this implies, of course, that there is a way to set the default code page, which I've not been able to find).  From this, it appears that it's simply not possible to do the kind of testing I want to do here; if someone knows otherwise, please let me know.

SVN-Revision: 1681

15 years agoSuppress some "unused return value" warnings from clang.
Tim Kientzle [Sun, 29 Nov 2009 20:17:10 +0000 (15:17 -0500)] 
Suppress some "unused return value" warnings from clang.

SVN-Revision: 1680

15 years agoFailure to decompress a single entry is not a FATAL problem (the entire archive is...
Tim Kientzle [Sun, 29 Nov 2009 20:16:17 +0000 (15:16 -0500)] 
Failure to decompress a single entry is not a FATAL problem (the entire archive is not dead), it's merely a FAILED problem (this entry is dead, but the rest of the archive may be readable).

SVN-Revision: 1679

15 years agoIf we don't have any way to decompress a test archive (neither library nor command...
Tim Kientzle [Sun, 29 Nov 2009 20:14:52 +0000 (15:14 -0500)] 
If we don't have any way to decompress a test archive (neither library nor command-line util), just skip it.

SVN-Revision: 1678

15 years agoAdd RPM filter.
Michihiro NAKAJIMA [Mon, 23 Nov 2009 08:40:03 +0000 (03:40 -0500)] 
Add RPM filter.

SVN-Revision: 1677

15 years agoUse the standard abort() function to terminate the program if there's
Tim Kientzle [Thu, 19 Nov 2009 07:18:09 +0000 (02:18 -0500)] 
Use the standard abort() function to terminate the program if there's
a fatal API violation by a libarchive client.

SVN-Revision: 1675

15 years agoClang static analysis found an error return that was being
Tim Kientzle [Thu, 19 Nov 2009 07:15:10 +0000 (02:15 -0500)] 
Clang static analysis found an error return that was being
ignored.  If copying data from an archive into a file on disk
fails with a fatal read error, exit with an error, since we
can't progress if the archive is broken.  If it fails writing
to the file on disk, arrange for cpio to exit with an error.
Rename 'copy_data' to 'extract_data' to make it clearer that
it's only used when extracting data to disk.

Thanks to Michihiro NAKAJIMA for performing the analysis and fixing
most of the issues found.

SVN-Revision: 1674

15 years agoUse _CrtSetReportMode only where available
Brad King [Wed, 18 Nov 2009 14:15:28 +0000 (09:15 -0500)] 
Use _CrtSetReportMode only where available

We test for this function in <crtdbg.h> at CMake configuration time and
store the result as a HAVE__CrtSetReportMode configuration macro.  We
need not perform the test for an autotools build because it supports no
platform that provides the function and the macro will be undefined.

SVN-Revision: 1673

15 years agoUse ADD_TEST_28 macro to fix tests with the VS IDE
Brad King [Wed, 18 Nov 2009 14:14:18 +0000 (09:14 -0500)] 
Use ADD_TEST_28 macro to fix tests with the VS IDE

This macro simplifies creation of tests that refer to executables built
in the project.  We can pass executables as arguments to a test using a
CMake 2.8 "generator expression" of the form "$<TARGET_FILE:myexe>".
The macro translates the arguments into something CMake 2.6 understands.

This change also fixes the tests so that they run correctly in build
trees created for multi-configuration build tools like the VS IDE.
These tools place executables in a per-configuration subdirectory so
references to executables in test arguments must use a test-time
substitution.  The ADD_TEST_28 macro handles this automatically.

SVN-Revision: 1672

15 years agoCreate ADD_TEST_28 macro to approximate CMake 2.8
Brad King [Wed, 18 Nov 2009 14:14:08 +0000 (09:14 -0500)] 
Create ADD_TEST_28 macro to approximate CMake 2.8

CMake 2.8 provides a new ADD_TEST(NAME) signature that simplifies
creation of tests that refer to executables built in the project.  We
create an ADD_TEST_28 macro to approximate the new signature but work
with CMake 2.6.

SVN-Revision: 1671

15 years agoRequire CMake 2.6.3 or higher
Brad King [Wed, 18 Nov 2009 14:14:00 +0000 (09:14 -0500)] 
Require CMake 2.6.3 or higher

Previously we required CMake 2.6.1 or higher, but CMake 2.6.3 provides
component-wise VERSION_LESS, VERSION_GREATER, and VERSION_EQUAL tests in
the if() command and the CMAKE_VERSION variable.  Once the running CMake
is known to be 2.6.3 or higher, tests against its version are simple.

We also use the FATAL_ERROR option to CMAKE_MINIMUM_REQUIRED() to ensure
that CMake 2.4 gives up with an error immediately.

SVN-Revision: 1670

15 years agoIncrease the limit for the -b option from 1024 to 8192.
Tim Kientzle [Wed, 18 Nov 2009 06:26:03 +0000 (01:26 -0500)] 
Increase the limit for the -b option from 1024 to 8192.

Thanks to Tim Jones.

SVN-Revision: 1669

15 years agoUse assertEqualInt instead of assert.
Michihiro NAKAJIMA [Tue, 17 Nov 2009 13:47:37 +0000 (08:47 -0500)] 
Use assertEqualInt instead of assert.

Suggested by Tim

SVN-Revision: 1668

15 years agoRemove unnecessary changing the current working directory.
Michihiro NAKAJIMA [Tue, 17 Nov 2009 13:32:54 +0000 (08:32 -0500)] 
Remove unnecessary changing the current working directory.

SVN-Revision: 1667

15 years agoAvoid compiling error on linux.
Michihiro NAKAJIMA [Mon, 16 Nov 2009 22:22:20 +0000 (17:22 -0500)] 
Avoid compiling error on linux.

SVN-Revision: 1666

15 years agoRevert r1617.
Michihiro NAKAJIMA [Mon, 16 Nov 2009 22:19:49 +0000 (17:19 -0500)] 
Revert r1617.
My previous change caused error on linux.

SVN-Revision: 1665

15 years agoDo not set a birthtime to the archive entry if the birthtime is not
Michihiro NAKAJIMA [Mon, 16 Nov 2009 16:53:16 +0000 (11:53 -0500)] 
Do not set a birthtime to the archive entry if the birthtime is not
present in ISO image.

SVN-Revision: 1664

15 years agoPut local include dir first
Brad King [Mon, 16 Nov 2009 16:35:12 +0000 (11:35 -0500)] 
Put local include dir first

We configure a header file called "config.h" so the local include
directory should go first to avoid conflicts from system headers.

SVN-Revision: 1663

15 years agoConvert CRLF -> LF newlines
Brad King [Mon, 16 Nov 2009 16:35:06 +0000 (11:35 -0500)] 
Convert CRLF -> LF newlines

We fix the newlines in libarchive/archive_read_support_format_raw.c to
have UNIX newlines like all other sources.

SVN-Revision: 1662

15 years agoAdd try-compile for 'major'
Brad King [Mon, 16 Nov 2009 16:29:46 +0000 (11:29 -0500)] 
Add try-compile for 'major'

We define MAJOR_IN_MKDEV and MAJOR_IN_SYSMACROS from CMake by checking
sys/mkdev.h and sys/sysmacros.h for 'major'.  Previously these macros
were left unconfigured for CMake builds.

SVN-Revision: 1661

15 years agoInclude test.h first in test main.c sources
Brad King [Mon, 16 Nov 2009 16:29:40 +0000 (11:29 -0500)] 
Include test.h first in test main.c sources

This change makes the main.c source for each test executable consistent
with the other test sources.  It also ensures that config.h (through
test.h) is included before system headers, thus configuring system
header feature macros correctly.

SVN-Revision: 1660

15 years agoAdd missing include <limits.h>
Brad King [Mon, 16 Nov 2009 16:29:31 +0000 (11:29 -0500)] 
Add missing include <limits.h>

In archive_read_support_format_ar.c we use SIZE_MAX.  On some platforms
the constant is defined in <limits.h> so we should include it.

SVN-Revision: 1659

15 years agoInitialize passwd/group lookup result
Brad King [Mon, 16 Nov 2009 16:29:18 +0000 (11:29 -0500)] 
Initialize passwd/group lookup result

The "result" argument to functions get(pwu|grg)id_r and get(pw|gr)name_r
does not appear in the signatures provided on older platforms.  We set
the pointer to the result memory in case the function ignores it, thus
ensuring initialization.

SVN-Revision: 1658

15 years agoUse consistent function storage class
Brad King [Mon, 16 Nov 2009 16:29:10 +0000 (11:29 -0500)] 
Use consistent function storage class

Functions declared 'static' should be defined 'static' too.

SVN-Revision: 1657

15 years agoExtract ACL octal digit using mask of type 'int'
Brad King [Mon, 16 Nov 2009 16:28:59 +0000 (11:28 -0500)] 
Extract ACL octal digit using mask of type 'int'

In archive_read_support_format_tar.c we mask a mode with ~0777777 to
erase the non-ACL octal digits.  The mode is represented by int64_t so
the compiler sign-extends the our literal mask from type int to int64_t
for application of the & operator.

Unfortunately the resulting int64_t type is not allowed in switch() on
some old compilers (like HP).  Since we are looking only for values that
fit in an int after the mask anyway, we might as well cast to int for
the entire mask operation.  This also avoids depending on the compiler
to preserve the intention of the mask with sign-extension, making the
code easier to understand anyway.

SVN-Revision: 1656

15 years agoSimplify try-compile for SIZE_MAX
Brad King [Mon, 16 Nov 2009 16:28:51 +0000 (11:28 -0500)] 
Simplify try-compile for SIZE_MAX

This constant may be defined in one of a few headers that we always
include anyway.  It is simpler and more reliable to look for the
constant in all the possible headers at once.  Otherwise we would need
to store the result for each header in a separate cache entry.

SVN-Revision: 1655

15 years agoCover r1583.
Michihiro NAKAJIMA [Mon, 16 Nov 2009 16:08:12 +0000 (11:08 -0500)] 
Cover r1583.
* Add HAVE_FUTIMENS and HAVE_UTIMENSAT into build/cmake/config.h.in
* Sort function names in alphabetical order.

SVN-Revision: 1654

15 years agoOn Windows, building a client against a static libarchive
Tim Kientzle [Mon, 16 Nov 2009 06:26:09 +0000 (01:26 -0500)] 
On Windows, building a client against a static libarchive
requires LIBARCHIVE_STATIC be defined.

SVN-Revision: 1653

15 years agoIf gzip decompression stumbles at the very end, return the error.
Tim Kientzle [Fri, 13 Nov 2009 07:11:45 +0000 (02:11 -0500)] 
If gzip decompression stumbles at the very end, return the error.

Thanks to Michihiro NAKAJIMA and Clang Static Analyzer for pointing
out this oversight.

SVN-Revision: 1652

15 years agoFix ACL parsing bug that would erroneously set the mode bits for
Tim Kientzle [Fri, 13 Nov 2009 07:04:35 +0000 (02:04 -0500)] 
Fix ACL parsing bug that would erroneously set the mode bits for
the last ACL entry to 0.  Also, fix the test that was verifying
the wrong results.

Thanks to Michihiro Nakajima and Clang static analyzer for
finding this.

SVN-Revision: 1651

15 years agoWork around a compiler warning pointed out by Bill Hoffman.
Tim Kientzle [Fri, 13 Nov 2009 06:27:46 +0000 (01:27 -0500)] 
Work around a compiler warning pointed out by Bill Hoffman.
Also, clean up the whitespace here to match the BSD style
that's used in the rest of libarchive.

SVN-Revision: 1650

15 years agosvn:ignore the build libarchive.pc file.
Tim Kientzle [Fri, 13 Nov 2009 06:24:53 +0000 (01:24 -0500)] 
svn:ignore the build libarchive.pc file.

SVN-Revision: 1649

15 years agoThe ustar header for the 'x' entry in pax format can be simplified:
Tim Kientzle [Fri, 13 Nov 2009 06:22:01 +0000 (01:22 -0500)] 
The ustar header for the 'x' entry in pax format can be simplified:
ustar headers can't support high-res mtime and don't support atime
at all.

Also, work around an annoying compiler warning pointed out by Bill Hoffman.

SVN-Revision: 1648

15 years agoFix Borland integer constants
Brad King [Wed, 11 Nov 2009 17:13:34 +0000 (12:13 -0500)] 
Fix Borland integer constants

Some versions of Borland provide <stdint.h>, so we use it when possible.
However, the 64-bit signed and unsigned integer min/max constants cause
overflow warnings from Borland itself!  For these constants we fall back
on our default definitions.

SVN-Revision: 1647

15 years agoBorland does not prefix strdup, setmode, or umask
Brad King [Wed, 11 Nov 2009 14:20:44 +0000 (09:20 -0500)] 
Borland does not prefix strdup, setmode, or umask

Although MSVC and some other Windows compilers provide these functions
prefixed with '_', the Borland compiler does not.

SVN-Revision: 1646

15 years agoBorland signature of _open has no mode
Brad King [Wed, 11 Nov 2009 14:20:38 +0000 (09:20 -0500)] 
Borland signature of _open has no mode

SVN-Revision: 1645

15 years agoDo not include <sys/utime.h> on Borland
Brad King [Wed, 11 Nov 2009 14:20:32 +0000 (09:20 -0500)] 
Do not include <sys/utime.h> on Borland

The compiler does not provide this header, but it does not seem to be
needed anyway.

SVN-Revision: 1644

15 years agoUse ARCHIVE_ERRNO_FILE_FORMAT instead of EILSEQ
Brad King [Wed, 11 Nov 2009 14:20:26 +0000 (09:20 -0500)] 
Use ARCHIVE_ERRNO_FILE_FORMAT instead of EILSEQ

We define ARCHIVE_ERRNO_FILE_FORMAT in "archive_platform.h" for
compatibility with platforms that do not have EILSEQ.  Therefore we
should use it in "archive_write_set_format_pax.c".

SVN-Revision: 1643

15 years agoDisable inline keyword for Borland and old HP-UX
Brad King [Wed, 11 Nov 2009 14:20:20 +0000 (09:20 -0500)] 
Disable inline keyword for Borland and old HP-UX

SVN-Revision: 1642

15 years agoFix size_t and ssize_t defaults on Borland
Brad King [Wed, 11 Nov 2009 14:20:14 +0000 (09:20 -0500)] 
Fix size_t and ssize_t defaults on Borland

We use more generic decision tests to select these types.  The new tests
choose the proper types for Borland while preserving reasonable defaults
for other compilers.

SVN-Revision: 1641

15 years agoFix uid_t, git_t, dev_t, and mode_t on Borland
Brad King [Wed, 11 Nov 2009 14:20:08 +0000 (09:20 -0500)] 
Fix uid_t, git_t, dev_t, and mode_t on Borland

SVN-Revision: 1640

15 years agoSelect stdint.h or inttypes.h in archive.h
Brad King [Wed, 11 Nov 2009 14:20:01 +0000 (09:20 -0500)] 
Select stdint.h or inttypes.h in archive.h

Since archive.h cannot use try-compile results it must memorize the
availability of integer type headers for every platform.  We split the
decision of which header to use out from the actual #include line by
defining __LA_STDINT_H to the chosen header.

SVN-Revision: 1639

15 years agoDo not redefine stat and file mode macros
Brad King [Wed, 11 Nov 2009 14:19:55 +0000 (09:19 -0500)] 
Do not redefine stat and file mode macros

Some windows compilers define macros like O_RDONLY and S_ISBLK with
leading underscores (e.g. _O_RDONLY and _S_ISBLK).  In our windows
compatibility header "archive_windows.h" we define the non-prefixed
names so that the rest of our code can use them everywhere.  However,
some windows compilers also define the non-prefixed names.  On these
compilers we should not redefine them.

SVN-Revision: 1638

15 years agoUse setmode compatiblity macro on Windows
Brad King [Wed, 11 Nov 2009 14:19:49 +0000 (09:19 -0500)] 
Use setmode compatiblity macro on Windows

Instead of duplicating preprocessor tests to call setmode or _setmode,
we define setmode to _setmode on Windows.

SVN-Revision: 1637

15 years agoProvide SetFilePointerEx for VS 6
Brad King [Wed, 11 Nov 2009 14:19:40 +0000 (09:19 -0500)] 
Provide SetFilePointerEx for VS 6

Visual Studio 6 does not provide SetFilePointerEx in its Windows API.
We implement it in terms of SetFilePointer for that compiler.

SVN-Revision: 1636

15 years agoUse macro for 64-bit integer literal suffixes
Brad King [Wed, 11 Nov 2009 14:19:34 +0000 (09:19 -0500)] 
Use macro for 64-bit integer literal suffixes

Some compilers, such as Borland and VS 6, define __int64 instead of the
more standard long long.  Integer literals of type __int64 use the
suffix 'i64' instead of 'll'.  We define the helper macros

  ARCHIVE_LITERAL_LL(n)
  ARCHIVE_LITERAL_ULL(n)

for 'long long' and 'unsigned long long' literals.  The macros use the
proper suffix for the current compiler.

SVN-Revision: 1635

15 years agoConfigure intptr_t and uintptr_t defaults
Brad King [Wed, 11 Nov 2009 14:19:27 +0000 (09:19 -0500)] 
Configure intptr_t and uintptr_t defaults

We define these to 32- or 64-bit signed and unsigned integer types
depending on the pointer size of the target platform.

SVN-Revision: 1634

15 years agoFix wincrypt.h inclusion on VS 6
Brad King [Wed, 11 Nov 2009 14:19:19 +0000 (09:19 -0500)] 
Fix wincrypt.h inclusion on VS 6

The VS 6 version of wincrypt.h only works if _WIN32_WINNT >= 0x0400.
We block its inclusion through windows.h by defining NOCRYPT, and then
define _WIN32_WINNT and include it only when necessary.

SVN-Revision: 1633

15 years agoDefault (u)intmax_t to (u)int64_t
Brad King [Wed, 11 Nov 2009 14:19:14 +0000 (09:19 -0500)] 
Default (u)intmax_t to (u)int64_t

This approach re-uses any work done to choose int64_t and uint64_t to
define defaults for intmax_t and uintmax_t.

SVN-Revision: 1632

15 years agoUse __int64 for int64_t default on Windows
Brad King [Wed, 11 Nov 2009 14:19:08 +0000 (09:19 -0500)] 
Use __int64 for int64_t default on Windows

Many windows compilers define __int64 as a 64-bit type, not just MSVC.

SVN-Revision: 1631

15 years agoUse standard defaults for (u)int32_t and uint16_t
Brad King [Wed, 11 Nov 2009 14:19:02 +0000 (09:19 -0500)] 
Use standard defaults for (u)int32_t and uint16_t

The mapping

  int32_t  -> int
  uint32_t -> unsigned int
  uint16_t -> unsigned short

is valid on many compilers, not just MSVC.

SVN-Revision: 1630

15 years agoProbe for cygwin_conv_path in cmake build, for Cygwin 1.7.
Tim Kientzle [Wed, 11 Nov 2009 07:50:13 +0000 (02:50 -0500)] 
Probe for cygwin_conv_path in cmake build, for Cygwin 1.7.

SVN-Revision: 1629

15 years agoValue stored to 'code' is never read.
Michihiro NAKAJIMA [Mon, 9 Nov 2009 11:06:48 +0000 (06:06 -0500)] 
Value stored to 'code' is never read.

Found by Clang Static Analyzer.

SVN-Revision: 1628

15 years agoValue stored to 'i' is never read.
Michihiro NAKAJIMA [Mon, 9 Nov 2009 11:01:45 +0000 (06:01 -0500)] 
Value stored to 'i' is never read.

Found by Clang Static Analyzer.

SVN-Revision: 1627

15 years agoTeach it to compiler and analyzer that function `lafe_errc' is no return.
Michihiro NAKAJIMA [Mon, 9 Nov 2009 10:56:48 +0000 (05:56 -0500)] 
Teach it to compiler and analyzer that function `lafe_errc' is no return.

Found by Clang Static Analyzer.

SVN-Revision: 1626

15 years agoValue stored to 'i' is never read.
Michihiro NAKAJIMA [Mon, 9 Nov 2009 08:03:27 +0000 (03:03 -0500)] 
Value stored to 'i' is never read.

Found by Clang Static Analyzer.

SVN-Revision: 1625

15 years agoAvoid possibility dereference of null pointer.
Michihiro NAKAJIMA [Mon, 9 Nov 2009 07:58:11 +0000 (02:58 -0500)] 
Avoid possibility dereference of null pointer.

Found by Clang Static Analyzer.

SVN-Revision: 1624

15 years agoAlthough the value stored to 'v' is used in the enclosing expression,
Michihiro NAKAJIMA [Mon, 9 Nov 2009 07:27:38 +0000 (02:27 -0500)] 
Although the value stored to 'v' is used in the enclosing expression,
the value is never actually read from 'v'

Found by Clang Static Analyzer.

SVN-Revision: 1623

15 years agoAlthough the value stored to 'ret2' is used in the enclosing expression,
Michihiro NAKAJIMA [Mon, 9 Nov 2009 07:24:57 +0000 (02:24 -0500)] 
Although the value stored to 'ret2' is used in the enclosing expression,
the value is never actually read from 'ret2'.

Found by Clang Static Analyzer.

SVN-Revision: 1622

15 years agoAlthough the value stored to 'p' is used in the enclosing expression,
Michihiro NAKAJIMA [Mon, 9 Nov 2009 07:21:54 +0000 (02:21 -0500)] 
Although the value stored to 'p' is used in the enclosing expression,
the value is never actually read from 'p'

Found by Clang Static Analyzer.

SVN-Revision: 1621

15 years ago- Value stored to 'data' is never read.
Michihiro NAKAJIMA [Mon, 9 Nov 2009 07:15:09 +0000 (02:15 -0500)] 
- Value stored to 'data' is never read.
- Value stored to 'data_length' is never read.

Found by Clang Static Analyzer.

SVN-Revision: 1620

15 years agoValue stored to 'used' is never read.
Michihiro NAKAJIMA [Mon, 9 Nov 2009 07:06:16 +0000 (02:06 -0500)] 
Value stored to 'used' is never read.

Found by Clang Static Analyzer.

SVN-Revision: 1619

15 years ago- Value stored to 'pax' is never read.
Michihiro NAKAJIMA [Mon, 9 Nov 2009 06:58:12 +0000 (01:58 -0500)] 
- Value stored to 'pax' is never read.
- Value stored to 'p' is never read.
- Value stored to 'd' is never read.

Found by Clang Static Analyzer.

SVN-Revision: 1618

15 years agoValue stored to 's' is never read.
Michihiro NAKAJIMA [Mon, 9 Nov 2009 06:49:03 +0000 (01:49 -0500)] 
Value stored to 's' is never read.

Found by Clang Static Analyzer.

SVN-Revision: 1617

15 years agoReturn ARCHIVE_WARN if large inode number was truncated.
Michihiro NAKAJIMA [Mon, 9 Nov 2009 06:43:09 +0000 (01:43 -0500)] 
Return ARCHIVE_WARN if large inode number was truncated.

Found by Clang Static Analyzer.

SVN-Revision: 1616