diff options
author | Tim Kientzle <kientzle@gmail.com> | 2009-05-24 19:35:53 -0400 |
---|---|---|
committer | Tim Kientzle <kientzle@gmail.com> | 2009-05-24 19:35:53 -0400 |
commit | b70fcb33e382ef56fe94c0a390688f09be1fca63 (patch) | |
tree | 5f166a4bb2e1d094ddd7acf4ce79976628d94f57 /libarchive/test/test_acl_pax.c | |
parent | 65abade3da1c554bead012e75a7a415b25fc1d8f (diff) | |
download | libarchive-b70fcb33e382ef56fe94c0a390688f09be1fca63.tar.gz |
Be more careful about text/binary mode.
Libarchive is already pretty careful about using O_BINARY
whenever it opens a file handle internally; this extends
that care to file descriptors that are passed in from clients
by invoking _setmode() explicitly.
The test harness was much less careful about O_BINARY;
this adds those flags to all open() calls and modifies
fopen() calls to use "wb" and "rb" explicitly.
In particular, this should remove the need for clients
to use invoke _set_fmode() at all.
This is not yet completely tested...
SVN-Revision: 1103
Diffstat (limited to 'libarchive/test/test_acl_pax.c')
-rw-r--r-- | libarchive/test/test_acl_pax.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libarchive/test/test_acl_pax.c b/libarchive/test/test_acl_pax.c index 26329cba..1d616a81 100644 --- a/libarchive/test/test_acl_pax.c +++ b/libarchive/test/test_acl_pax.c @@ -453,12 +453,14 @@ DEFINE_TEST(test_acl_pax) #endif /* Write out the data we generated to a file for manual inspection. */ - assert(-1 < (fd = open("testout", O_WRONLY | O_CREAT | O_TRUNC, 0775))); + assert(-1 < (fd = open("testout", + O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0775))); assert(used == (size_t)write(fd, buff, (unsigned int)used)); close(fd); /* Write out the reference data to a file for manual inspection. */ - assert(-1 < (fd = open("reference", O_WRONLY | O_CREAT | O_TRUNC, 0775))); + assert(-1 < (fd = open("reference", + O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0775))); assert(sizeof(reference) == write(fd, reference, sizeof(reference))); close(fd); |