]> git.ipfire.org Git - thirdparty/zstd.git/commit
UTIL_getFileSize() returns UTIL_FILESIZE_UNKNOWN on failure
authorYann Collet <cyan@fb.com>
Tue, 17 Oct 2017 23:14:25 +0000 (16:14 -0700)
committerYann Collet <cyan@fb.com>
Tue, 17 Oct 2017 23:14:25 +0000 (16:14 -0700)
commit18b795374a4d1e0b308fdf6e86b1ea08b4489489
tree3d77d2243be155b353c16dba4d085a91e725344c
parent32c9f715ae1532d4ea06ee5f811ed61c46e48d31
UTIL_getFileSize() returns UTIL_FILESIZE_UNKNOWN on failure

UTIL_getFileSize() used to return zero on failure.
This made it impossible to distinguish a failure from a genuine empty file.
Both cases where coalesced.

Adding UTIL_FILESIZE_UNKNOWN constant has many consequences on user code,
since in many places, the `0` was assumed to mean "error".
This is no longer the case, and the error code must be actively checked.
programs/bench.c
programs/dibio.c
programs/fileio.c
programs/util.h
tests/fullbench.c
tests/paramgrill.c
zlibWrapper/examples/zwrapbench.c