#5908: Check for tr_loadFile return value instead of errno in tr_variantFromFile

Seems like there could be a defect in uClibc making errno not
thread-local. Don't rely on errno value but check function return value
instead which is a better failure indicator.

Return errors from `tr_loadFile` and `tr_variantFromFile` via tr_error.
Fix `tr_sessionLoadSettings` to not fail on Windows if settings.json
does not exist.
This commit is contained in:
Mike Gelfand
2015-04-11 10:51:59 +00:00
parent 99e0f5bd63
commit 3b129a72d8
19 changed files with 91 additions and 81 deletions

View File

@@ -532,7 +532,7 @@ getEncodedMetainfo (const char * filename)
{
size_t len = 0;
char * b64 = NULL;
uint8_t * buf = tr_loadFile (filename, &len);
uint8_t * buf = tr_loadFile (filename, &len, NULL);
if (buf)
{