daybreak: sort folders alphabetically and only display success message on success (#1075)

(cherry picked from commit f6893b1fff4219d81a6ecc87361fb383096fc990)
This commit is contained in:
Adubbz 2020-07-08 13:06:21 +10:00 committed by GitHub
parent 499f29d2f0
commit 0cac10a2f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,6 +13,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <algorithm>
#include <cstdarg>
#include <cstdio>
#include <cstring>
@ -382,6 +383,12 @@ namespace dbk {
/* Close the directory. */
closedir(dir);
/* Sort the file entries. */
std::sort(m_file_entries.begin(), m_file_entries.end(), [](const FileEntry &a, const FileEntry &b) {
return strncmp(a.name, b.name, sizeof(a.name)) < 0;
});
return 0;
}
@ -866,10 +873,11 @@ namespace dbk {
/* Apply the prepared update. */
if (R_FAILED(rc = amssuApplyPreparedUpdate())) {
this->LogText("Failed to apply update.\nResult: 0x%08x\n", rc);
}
} else {
/* Log success. */
this->LogText("Update applied successfully.\n");
}
this->MarkForReboot();
return rc;
}