Use fstat() to determine file size.
authorNiklas Hambüchen <mail@nh2.me>
Mon, 24 Aug 2020 04:23:51 +0000 (06:23 +0200)
committerNiklas Hambüchen <mail@nh2.me>
Mon, 24 Aug 2020 04:27:28 +0000 (06:27 +0200)
commit9a7658070aeca2c0a6c68e5025a80f9e4b847ad7
tree02082f6462611113623f51e56ac3dec07ccaa5d0
parent34fe7c9d7f4fbeeb42c22f4ad1a01c1771d14268
Use fstat() to determine file size.

This allows us to get the file size even when the input file is passed
via stdin. This fixes `--content-size` not working in situations like

    $ lz4 -v --content-size < /tmp/test > /tmp/test.lz4
    Warning : cannot determine input content size

With this change, it works.

Also helps with #904.
programs/lz4io.c
programs/util.h