[thin_check] Fix bug in clear needs check logic.

Mixed up bools and int returns.
This commit is contained in:
Joe Thornber 2014-04-02 13:43:16 +01:00
parent 7eabc78d6d
commit 05b18a5b99

View File

@ -232,7 +232,9 @@ namespace {
write_superblock(bm, sb); write_superblock(bm, sb);
} }
bool check(string const &path, flags fs) { // Returns 0 on success, 1 on failure (this gets returned directly
// by main).
int check(string const &path, flags fs) {
error_state err; error_state err;
bool success = false; bool success = false;
@ -244,7 +246,7 @@ namespace {
else else
success = (err == NO_ERROR) ? 0 : 1; success = (err == NO_ERROR) ? 0 : 1;
if (success && fs.clear_needs_check_flag_on_success) if (!success && fs.clear_needs_check_flag_on_success)
clear_needs_check(path); clear_needs_check(path);
} catch (std::exception &e) { } catch (std::exception &e) {