tree-wide: Replace assert() by assert_se() when there is side effect

This commit is contained in:
Benjamin Robin 2020-05-08 13:32:11 +02:00 committed by Lennart Poettering
parent b2da95cfa1
commit 20c3acfaad
3 changed files with 4 additions and 4 deletions

View File

@ -2777,7 +2777,7 @@ void unit_unwatch_pid(Unit *u, pid_t pid) {
if (m == 0) {
/* The array is now empty, remove the entire entry */
assert(hashmap_remove(u->manager->watch_pids, PID_TO_PTR(-pid)) == array);
assert_se(hashmap_remove(u->manager->watch_pids, PID_TO_PTR(-pid)) == array);
free(array);
}
}

View File

@ -220,8 +220,8 @@ static int import_fs(int argc, char *argv[], void *userdata) {
finish:
/* Put old signal handlers into place */
assert(sigaction(SIGINT, &old_sigint_sa, NULL) >= 0);
assert(sigaction(SIGTERM, &old_sigterm_sa, NULL) >= 0);
assert_se(sigaction(SIGINT, &old_sigint_sa, NULL) >= 0);
assert_se(sigaction(SIGTERM, &old_sigterm_sa, NULL) >= 0);
return 0;
}

View File

@ -20,7 +20,7 @@ static void test_parse_sleep_config(void) {
_cleanup_(free_sleep_configp) SleepConfig *sleep_config = NULL;
log_info("/* %s */", __func__);
assert(parse_sleep_config(&sleep_config) == 0);
assert_se(parse_sleep_config(&sleep_config) == 0);
_cleanup_free_ char *sum, *sus, *him, *his, *hym, *hys;