Marti Bolivar
authored
We still hardcode paths, but this is better.
- Initialize lengthOfInputFile and bufferSize to 0 in case input isn't
found.
- Pull call to fopen out of ifdefs, so a future patch can just rip out
the hardcoded path parts.
- If input _is_ found, then don't leak the file descriptor when the
FileReaderThread gets deleted.
- If input isn't found, emit a sensible error message and bail in the
constructor when the file isn't found. Have subsequent calls that
try to use the FileReaderThread fail instead of crash.
Signed-off-by:
Marti Bolivar <mbolivar@leaflabs.com>