aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2009-12-07 21:46:53 +0200
committerLasse Collin <lasse.collin@tukaani.org>2009-12-07 21:46:53 +0200
commit7b76a3e2336f25088957cba92b0dbd854d9caa3c (patch)
treec3b8582c6c0a20b057c7927d8de2d74edd841e57
parentAdd Czech translation. (diff)
downloadxz-7b76a3e2336f25088957cba92b0dbd854d9caa3c.tar.xz
Fix file_io.c on DOS-like systems.
The problem was introduced when adding sparse file support in 465d1b0d6518c5d980f2db4c2d769f9905bdd902. Thanks to Charles Wilson.
-rw-r--r--src/xz/file_io.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/xz/file_io.c b/src/xz/file_io.c
index ca42bed9..18b7b044 100644
--- a/src/xz/file_io.c
+++ b/src/xz/file_io.c
@@ -40,9 +40,11 @@ static bool warn_fchown;
/// If true, try to create sparse files when decompressing.
static bool try_sparse = true;
+#ifndef TUKLIB_DOSLIKE
/// File status flags of standard output. This is used by io_open_dest()
/// and io_close_dest().
static int stdout_flags = 0;
+#endif
static bool io_write_buf(file_pair *pair, const uint8_t *buf, size_t size);
@@ -633,6 +635,7 @@ io_open_dest(file_pair *pair)
static int
io_close_dest(file_pair *pair, bool success)
{
+#ifndef TUKLIB_DOSLIKE
// If io_open_dest() has disabled O_APPEND, restore it here.
if (stdout_flags != 0) {
assert(pair->dest_fd == STDOUT_FILENO);
@@ -647,6 +650,7 @@ io_close_dest(file_pair *pair, bool success)
return -1;
}
}
+#endif
if (pair->dest_fd == -1 || pair->dest_fd == STDOUT_FILENO)
return 0;