]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tree-wide: Replace assert() by assert_se() when there is side effect
authorBenjamin Robin <dev@benjarobin.fr>
Fri, 8 May 2020 11:32:11 +0000 (13:32 +0200)
committerLennart Poettering <lennart@poettering.net>
Sun, 10 May 2020 07:23:12 +0000 (09:23 +0200)
src/core/unit.c
src/import/import-fs.c
src/test/test-sleep.c

index 24d7e901baf03169e4b4aabb272184e88ee4b66f..7c8bae9a0db0b700a82725d93ca7249df8220b80 100644 (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);
                 }
         }
index 5e61049ced8fe06d6560c3dc5f4447b6de06d326..db55fa50d5d9f2cc8dffb75922c5b68b5ddecfb5 100644 (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;
 }
index 014b1aa7a2f0eea88d54564cb61b9748159408c5..2e63aace0201ab696fb5ba04af384dd2f6459d2a 100644 (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;