From: Elena Mamontova Date: Wed, 4 Nov 2015 15:53:33 +0000 (+0200) Subject: Ticket 12. In the ReadUsers() method: the error variable added; return -1 removed X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/e9f74534ad9bd4df3cecab080f6b6ac9a6cb6b7c?hp=-c Ticket 12. In the ReadUsers() method: the error variable added; return -1 removed and error++ added after the ReadConf() and ReadStat() check; the error check and return -1 after the checking added. --- e9f74534ad9bd4df3cecab080f6b6ac9a6cb6b7c diff --git a/projects/stargazer/users_impl.cpp b/projects/stargazer/users_impl.cpp index bc440636..14c44604 100644 --- a/projects/stargazer/users_impl.cpp +++ b/projects/stargazer/users_impl.cpp @@ -344,6 +344,7 @@ if (store->GetUsersList(&usersList) < 0) user_iter ui; +unsigned errors = 0; for (unsigned int i = 0; i < usersList.size(); i++) { USER_IMPL u(settings, store, tariffs, sysAdmin, this, m_services); @@ -355,12 +356,14 @@ for (unsigned int i = 0; i < usersList.size(); i++) AddUserIntoIndexes(ui); if (ui->ReadConf() < 0) - return -1; + errors++; if (ui->ReadStat() < 0) - return -1; + errors++; } +if (errors > 0) + return -1; return 0; } //-----------------------------------------------------------------------------