tree-wide: Replace assert() by assert_se() when there is side effect
This commit is contained in:
parent
b2da95cfa1
commit
20c3acfaad
|
@ -2777,7 +2777,7 @@ void unit_unwatch_pid(Unit *u, pid_t pid) {
|
||||||
|
|
||||||
if (m == 0) {
|
if (m == 0) {
|
||||||
/* The array is now empty, remove the entire entry */
|
/* 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);
|
free(array);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -220,8 +220,8 @@ static int import_fs(int argc, char *argv[], void *userdata) {
|
||||||
|
|
||||||
finish:
|
finish:
|
||||||
/* Put old signal handlers into place */
|
/* Put old signal handlers into place */
|
||||||
assert(sigaction(SIGINT, &old_sigint_sa, NULL) >= 0);
|
assert_se(sigaction(SIGINT, &old_sigint_sa, NULL) >= 0);
|
||||||
assert(sigaction(SIGTERM, &old_sigterm_sa, NULL) >= 0);
|
assert_se(sigaction(SIGTERM, &old_sigterm_sa, NULL) >= 0);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ static void test_parse_sleep_config(void) {
|
||||||
_cleanup_(free_sleep_configp) SleepConfig *sleep_config = NULL;
|
_cleanup_(free_sleep_configp) SleepConfig *sleep_config = NULL;
|
||||||
log_info("/* %s */", __func__);
|
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;
|
_cleanup_free_ char *sum, *sus, *him, *his, *hym, *hys;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue