]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: rename unit_{start_limit|condition|assert}_test() to unit_test_xyz()
authorLennart Poettering <lennart@poettering.net>
Mon, 18 Mar 2019 11:21:27 +0000 (12:21 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 18 Mar 2019 15:06:36 +0000 (16:06 +0100)
Just some renaming, no change in behaviour.

Background: I'd like to add more functions unit_test_xyz() that test
various things, hence let's streamline the naming a bit.

src/core/automount.c
src/core/mount.c
src/core/path.c
src/core/service.c
src/core/socket.c
src/core/swap.c
src/core/timer.c
src/core/unit.c
src/core/unit.h

index 6a8373920eac1d66ed01197ae4d52dee4def9107..eff357bb3deac72e14a71737fd297c07d2878e32 100644 (file)
@@ -813,7 +813,7 @@ static int automount_start(Unit *u) {
                 return -ENOENT;
         }
 
-        r = unit_start_limit_test(u);
+        r = unit_test_start_limit(u);
         if (r < 0) {
                 automount_enter_dead(a, AUTOMOUNT_FAILURE_START_LIMIT_HIT);
                 return r;
index 8da818beeee685b8991a55f4621165ac1f1cc6c6..a991bf8794d418637b4eb887d5e38fa5501d8539 100644 (file)
@@ -1104,7 +1104,7 @@ static int mount_start(Unit *u) {
 
         assert(IN_SET(m->state, MOUNT_DEAD, MOUNT_FAILED));
 
-        r = unit_start_limit_test(u);
+        r = unit_test_start_limit(u);
         if (r < 0) {
                 mount_enter_dead(m, MOUNT_FAILURE_START_LIMIT_HIT);
                 return r;
index 831e49df29f2623b0f9e0a49ffaeae66fcf198a8..a7a7ec28aef33b76695b666617cc336cf8c9cb9b 100644 (file)
@@ -567,7 +567,7 @@ static int path_start(Unit *u) {
                 return -ENOENT;
         }
 
-        r = unit_start_limit_test(u);
+        r = unit_test_start_limit(u);
         if (r < 0) {
                 path_enter_dead(p, PATH_FAILURE_START_LIMIT_HIT);
                 return r;
index fc4e92389bba8ee5da685c6f8cb3ff47ce8c4180..bbe55322099f0275067f31ad10d5b75f40f60a86 100644 (file)
@@ -2364,7 +2364,7 @@ static int service_start(Unit *u) {
         assert(IN_SET(s->state, SERVICE_DEAD, SERVICE_FAILED));
 
         /* Make sure we don't enter a busy loop of some kind. */
-        r = unit_start_limit_test(u);
+        r = unit_test_start_limit(u);
         if (r < 0) {
                 service_enter_dead(s, SERVICE_FAILURE_START_LIMIT_HIT, false);
                 return r;
index 3b60914c8671c48d80ca13d8fd37ba2021d7df3d..fd550290bea5b72145b0754c7c37f20e3c017115 100644 (file)
@@ -2487,7 +2487,7 @@ static int socket_start(Unit *u) {
 
         assert(IN_SET(s->state, SOCKET_DEAD, SOCKET_FAILED));
 
-        r = unit_start_limit_test(u);
+        r = unit_test_start_limit(u);
         if (r < 0) {
                 socket_enter_dead(s, SOCKET_FAILURE_START_LIMIT_HIT);
                 return r;
index 2d8463b8b1812173ec019b0274eaf4d39799cff0..b836fdd3046764460b22c0cd2d96e652c2720deb 100644 (file)
@@ -871,7 +871,7 @@ static int swap_start(Unit *u) {
                 if (UNIT(other)->job && UNIT(other)->job->state == JOB_RUNNING)
                         return -EAGAIN;
 
-        r = unit_start_limit_test(u);
+        r = unit_test_start_limit(u);
         if (r < 0) {
                 swap_enter_dead(s, SWAP_FAILURE_START_LIMIT_HIT);
                 return r;
index 0c1ca3ef23369aa12312bae5ae5bb6087c639ece..736ffaa437a640261811e958fc5efb79af490c37 100644 (file)
@@ -607,7 +607,7 @@ static int timer_start(Unit *u) {
                 return -ENOENT;
         }
 
-        r = unit_start_limit_test(u);
+        r = unit_test_start_limit(u);
         if (r < 0) {
                 timer_enter_dead(t, TIMER_FAILURE_START_LIMIT_HIT);
                 return r;
index 4f89db02b65a5896d5bcae2c13d6305a3a2ce30d..9f75c976827fe710db2de50fea1a1c76e7b910d0 100644 (file)
@@ -1633,7 +1633,7 @@ static bool unit_condition_test_list(Unit *u, Condition *first, const char *(*to
         return triggered != 0;
 }
 
-static bool unit_condition_test(Unit *u) {
+static bool unit_test_condition(Unit *u) {
         assert(u);
 
         dual_timestamp_get(&u->condition_timestamp);
@@ -1644,7 +1644,7 @@ static bool unit_condition_test(Unit *u) {
         return u->condition_result;
 }
 
-static bool unit_assert_test(Unit *u) {
+static bool unit_test_assert(Unit *u) {
         assert(u);
 
         dual_timestamp_get(&u->assert_timestamp);
@@ -1667,7 +1667,7 @@ void unit_status_printf(Unit *u, const char *status, const char *unit_status_msg
         REENABLE_WARNING;
 }
 
-int unit_start_limit_test(Unit *u) {
+int unit_test_start_limit(Unit *u) {
         const char *reason;
 
         assert(u);
@@ -1764,14 +1764,14 @@ int unit_start(Unit *u) {
          * speed up activation in case there is some hold-off time,
          * but we don't want to recheck the condition in that case. */
         if (state != UNIT_ACTIVATING &&
-            !unit_condition_test(u)) {
+            !unit_test_condition(u)) {
                 log_unit_debug(u, "Starting requested but condition failed. Not starting unit.");
                 return -ECOMM;
         }
 
         /* If the asserts failed, fail the entire job */
         if (state != UNIT_ACTIVATING &&
-            !unit_assert_test(u)) {
+            !unit_test_assert(u)) {
                 log_unit_notice(u, "Starting requested but asserts failed.");
                 return -EPROTO;
         }
index 90d5e6f49db1d89013fe8f1f3f09f7ae08cf1223..8c67676c8ae2d13f14c0670adbf594a97b76e74d 100644 (file)
@@ -778,7 +778,7 @@ static inline bool unit_supported(Unit *u) {
 void unit_warn_if_dir_nonempty(Unit *u, const char* where);
 int unit_fail_if_noncanonical(Unit *u, const char* where);
 
-int unit_start_limit_test(Unit *u);
+int unit_test_start_limit(Unit *u);
 
 void unit_unref_uid(Unit *u, bool destroy_now);
 int unit_ref_uid(Unit *u, uid_t uid, bool clean_ipc);