public inbox for bzip2-devel@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: Joshua Watt <jpewhacker@gmail.com>
Cc: bzip2-devel@sourceware.org, Phil Ross <phil.ross@gmail.com>
Subject: Re: _stati64 patch (Was: [PATCH] Fix include path separator)
Date: Tue, 01 Jan 2019 00:00:00 -0000	[thread overview]
Message-ID: <03e0c9b1537ea400554213a7caef8855cc73aa04.camel@klomp.org> (raw)
In-Reply-To: <5867f77d-36b1-5ae2-1b53-5e1ee5a63323@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1451 bytes --]

Hi Joshua,

On Tue, 2019-07-09 at 10:00 -0500, Joshua Watt wrote:
> On 7/5/19 3:38 AM, Mark Wielaard wrote:
> > There is another Windows specific patch which we haven't applied yet
> > to the 1.0.x branch because we don't have Windows builders/testers.
> > 
> > It is the attached patch from Phil Ross (CCed) to use _stati64 instead
> > of _stat to support large >4GB files on Windows.
> > 
> > If you could test the above works on your setups that would be
> > appreciated.  Do we need any checks to see whether _stati64 is
> > available? Or can it be used unconditionally as in this patch?
> 
> The patch compiles without issues using msvc 18.0 (Visual Studio 2013) 
> and 64-bit MinGW gcc 7.3.0. 'make test' passes also.

Thanks for the extra testing. Lets apply this patch then.
It would be good to be able to handle large files on Windows too.

> The "patch in a patch" format was a little confusing at first :)

Oops, sorry, I wanted to make sure I cherry-picked the original patch
from Phil, but in doing so, I got the patch-in-patch variant. I applied
the straight diff one (as attached) so that the source matches what was
applied on the 1.1.x branch.

BTW. I don't know much about windows, and I assume it doesn't ship with
bash. But maybe you could take a peek at the bzip2-tests repository and
see if you could somehow make that work on Windows?
https://sourceware.org/git/bzip2-tests.git

Cheers,

Mark

[-- Attachment #2: 0001-Fix-a-not-a-normal-file-error-when-compressing-large.patch --]
[-- Type: text/x-patch, Size: 981 bytes --]

From 13d8bce0393ca21cbca1e8ba7692466a64fd46dd Mon Sep 17 00:00:00 2001
From: Phil Ross <phil.ross@gmail.com>
Date: Tue, 21 May 2019 20:46:14 +0100
Subject: [PATCH] Fix a 'not a normal file' error when compressing large files.

The bzip2 command line would report 'not a normal file' for files of
size larger than 2^32 - 1 bytes.

Patch bzip2.c to use _stati64 instead of _stat so that a successful
result is returned for large files.

Resolves https://github.com/philr/bzip2-windows/issues/3.
---
 bzip2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bzip2.c b/bzip2.c
index be3b3be..76c6c94 100644
--- a/bzip2.c
+++ b/bzip2.c
@@ -132,8 +132,8 @@
 
 #   define NORETURN       /**/
 #   define PATH_SEP       '\\'
-#   define MY_LSTAT       _stat
-#   define MY_STAT        _stat
+#   define MY_LSTAT       _stati64
+#   define MY_STAT        _stati64
 #   define MY_S_ISREG(x)  ((x) & _S_IFREG)
 #   define MY_S_ISDIR(x)  ((x) & _S_IFDIR)
 
-- 
1.8.3.1


  reply	other threads:[~2019-07-09 21:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-01  0:00 [PATCH] Fix include path separator Joshua Watt
2019-01-01  0:00 ` Mark Wielaard
     [not found]   ` <CAJdd5GZfTk8EKeUE_C1keKm+gn=qapv9OQGGariiiXP9jyu0wQ@mail.gmail.com>
2019-01-01  0:00     ` _stati64 patch (Was: [PATCH] Fix include path separator) Mark Wielaard
2019-01-01  0:00       ` Joshua Watt
2019-01-01  0:00         ` Mark Wielaard [this message]
2019-01-01  0:00           ` Joshua Watt
2019-01-01  0:00             ` Mark Wielaard
2019-01-01  0:00               ` Joshua Watt
2019-01-01  0:00                 ` Mark Wielaard
2019-01-01  0:00                   ` Joshua Watt
2019-01-01  0:00     ` [PATCH] Fix include path separator Mark Wielaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=03e0c9b1537ea400554213a7caef8855cc73aa04.camel@klomp.org \
    --to=mark@klomp.org \
    --cc=bzip2-devel@sourceware.org \
    --cc=jpewhacker@gmail.com \
    --cc=phil.ross@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).