summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2024-10-14 19:53:28 +0200
committerMike Yuan <me@yhndnzj.com>2024-10-27 20:02:46 +0100
commitd993ad6c6fa0cdb423a4e04697afa3e8dc67ded7 (patch)
tree99df406690370b931558dfe0d364517acab2dd92
parentcore/job: trivial modernization (diff)
downloadsystemd-d993ad6c6fa0cdb423a4e04697afa3e8dc67ded7.tar.xz
systemd-d993ad6c6fa0cdb423a4e04697afa3e8dc67ded7.zip
core/manager: introduce manager_add_job_full() which takes extra TransactionAddFlags
No functional change. Preparation for later commits.
-rw-r--r--src/analyze/analyze-verify-util.c2
-rw-r--r--src/core/automount.c4
-rw-r--r--src/core/dbus-unit.c2
-rw-r--r--src/core/dbus.c2
-rw-r--r--src/core/main.c4
-rw-r--r--src/core/manager.c19
-rw-r--r--src/core/manager.h24
-rw-r--r--src/core/path.c2
-rw-r--r--src/core/service.c5
-rw-r--r--src/core/socket.c4
-rw-r--r--src/core/timer.c2
-rw-r--r--src/core/transaction.h21
-rw-r--r--src/core/unit.c10
-rw-r--r--src/test/test-engine.c24
14 files changed, 75 insertions, 50 deletions
diff --git a/src/analyze/analyze-verify-util.c b/src/analyze/analyze-verify-util.c
index 017d4b4672..97f5449b0b 100644
--- a/src/analyze/analyze-verify-util.c
+++ b/src/analyze/analyze-verify-util.c
@@ -251,7 +251,7 @@ static int verify_unit(Unit *u, bool check_man, const char *root) {
unit_dump(u, stdout, "\t");
log_unit_debug(u, "Creating %s/start job", u->id);
- r = manager_add_job(u->manager, JOB_START, u, JOB_REPLACE, NULL, &error, NULL);
+ r = manager_add_job(u->manager, JOB_START, u, JOB_REPLACE, &error, /* ret = */ NULL);
if (r < 0)
log_unit_error_errno(u, r, "Failed to create %s/start: %s", u->id, bus_error_message(&error, r));
diff --git a/src/core/automount.c b/src/core/automount.c
index 9d0f7a1f6f..ac81875442 100644
--- a/src/core/automount.c
+++ b/src/core/automount.c
@@ -781,7 +781,7 @@ static void automount_enter_running(Automount *a) {
goto fail;
}
- r = manager_add_job(UNIT(a)->manager, JOB_START, trigger, JOB_REPLACE, NULL, &error, NULL);
+ r = manager_add_job(UNIT(a)->manager, JOB_START, trigger, JOB_REPLACE, &error, /* ret = */ NULL);
if (r < 0) {
log_unit_warning(UNIT(a), "Failed to queue mount startup job: %s", bus_error_message(&error, r));
goto fail;
@@ -997,7 +997,7 @@ static int automount_dispatch_io(sd_event_source *s, int fd, uint32_t events, vo
goto fail;
}
- r = manager_add_job(UNIT(a)->manager, JOB_STOP, trigger, JOB_REPLACE, NULL, &error, NULL);
+ r = manager_add_job(UNIT(a)->manager, JOB_STOP, trigger, JOB_REPLACE, &error, /* ret = */ NULL);
if (r < 0) {
log_unit_warning(UNIT(a), "Failed to queue unmount job: %s", bus_error_message(&error, r));
goto fail;
diff --git a/src/core/dbus-unit.c b/src/core/dbus-unit.c
index 2db473fbed..03f25402a2 100644
--- a/src/core/dbus-unit.c
+++ b/src/core/dbus-unit.c
@@ -1864,7 +1864,7 @@ int bus_unit_queue_job_one(
return -ENOMEM;
}
- r = manager_add_job(u->manager, type, u, mode, affected, error, &j);
+ r = manager_add_job_full(u->manager, type, u, mode, /* extra_flags = */ 0, affected, error, &j);
if (r < 0)
return r;
diff --git a/src/core/dbus.c b/src/core/dbus.c
index 2692dde151..744b97f991 100644
--- a/src/core/dbus.c
+++ b/src/core/dbus.c
@@ -175,7 +175,7 @@ static int signal_activation_request(sd_bus_message *message, void *userdata, sd
goto failed;
}
- r = manager_add_job(m, JOB_START, u, JOB_REPLACE, NULL, &error, NULL);
+ r = manager_add_job(m, JOB_START, u, JOB_REPLACE, &error, /* ret = */ NULL);
if (r < 0)
goto failed;
diff --git a/src/core/main.c b/src/core/main.c
index 0c171a788d..93a1e221f7 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -2582,13 +2582,13 @@ static int do_queue_default_job(
assert(target->load_state == UNIT_LOADED);
- r = manager_add_job(m, JOB_START, target, JOB_ISOLATE, NULL, &error, &job);
+ r = manager_add_job(m, JOB_START, target, JOB_ISOLATE, &error, &job);
if (r == -EPERM) {
log_debug_errno(r, "Default target could not be isolated, starting instead: %s", bus_error_message(&error, r));
sd_bus_error_free(&error);
- r = manager_add_job(m, JOB_START, target, JOB_REPLACE, NULL, &error, &job);
+ r = manager_add_job(m, JOB_START, target, JOB_REPLACE, &error, &job);
if (r < 0) {
*ret_error_message = "Failed to start default target";
return log_struct_errno(LOG_EMERG, r,
diff --git a/src/core/manager.c b/src/core/manager.c
index 57b7c3cbd8..f58bc547a6 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -1553,7 +1553,7 @@ static unsigned manager_dispatch_stop_when_unneeded_queue(Manager *m) {
}
/* Ok, nobody needs us anymore. Sniff. Then let's commit suicide */
- r = manager_add_job(u->manager, JOB_STOP, u, JOB_FAIL, NULL, &error, NULL);
+ r = manager_add_job(u->manager, JOB_STOP, u, JOB_FAIL, &error, /* ret = */ NULL);
if (r < 0)
log_unit_warning_errno(u, r, "Failed to enqueue stop job, ignoring: %s", bus_error_message(&error, r));
}
@@ -1594,7 +1594,7 @@ static unsigned manager_dispatch_start_when_upheld_queue(Manager *m) {
continue;
}
- r = manager_add_job(u->manager, JOB_START, u, JOB_FAIL, NULL, &error, NULL);
+ r = manager_add_job(u->manager, JOB_START, u, JOB_FAIL, &error, /* ret = */ NULL);
if (r < 0)
log_unit_warning_errno(u, r, "Failed to enqueue start job, ignoring: %s", bus_error_message(&error, r));
}
@@ -1635,7 +1635,7 @@ static unsigned manager_dispatch_stop_when_bound_queue(Manager *m) {
continue;
}
- r = manager_add_job(u->manager, JOB_STOP, u, JOB_REPLACE, NULL, &error, NULL);
+ r = manager_add_job(u->manager, JOB_STOP, u, JOB_REPLACE, &error, /* ret = */ NULL);
if (r < 0)
log_unit_warning_errno(u, r, "Failed to enqueue stop job, ignoring: %s", bus_error_message(&error, r));
}
@@ -2109,11 +2109,12 @@ int manager_startup(Manager *m, FILE *serialization, FDSet *fds, const char *roo
return 0;
}
-int manager_add_job(
+int manager_add_job_full(
Manager *m,
JobType type,
Unit *unit,
JobMode mode,
+ TransactionAddFlags extra_flags,
Set *affected_jobs,
sd_bus_error *error,
Job **ret) {
@@ -2122,9 +2123,10 @@ int manager_add_job(
int r;
assert(m);
- assert(type < _JOB_TYPE_MAX);
+ assert(type >= 0 && type < _JOB_TYPE_MAX);
assert(unit);
- assert(mode < _JOB_MODE_MAX);
+ assert(mode >= 0 && mode < _JOB_MODE_MAX);
+ assert((extra_flags & ~_TRANSACTION_FLAGS_MASK_PUBLIC) == 0);
if (mode == JOB_ISOLATE && type != JOB_START)
return sd_bus_error_set(error, SD_BUS_ERROR_INVALID_ARGS, "Isolate is only valid for start.");
@@ -2154,7 +2156,8 @@ int manager_add_job(
TRANSACTION_MATTERS |
(IN_SET(mode, JOB_IGNORE_DEPENDENCIES, JOB_IGNORE_REQUIREMENTS) ? TRANSACTION_IGNORE_REQUIREMENTS : 0) |
(mode == JOB_IGNORE_DEPENDENCIES ? TRANSACTION_IGNORE_ORDER : 0) |
- (mode == JOB_RESTART_DEPENDENCIES ? TRANSACTION_PROPAGATE_START_AS_RESTART : 0),
+ (mode == JOB_RESTART_DEPENDENCIES ? TRANSACTION_PROPAGATE_START_AS_RESTART : 0) |
+ extra_flags,
error);
if (r < 0)
return r;
@@ -2200,7 +2203,7 @@ int manager_add_job_by_name(Manager *m, JobType type, const char *name, JobMode
return r;
assert(unit);
- return manager_add_job(m, type, unit, mode, affected_jobs, e, ret);
+ return manager_add_job_full(m, type, unit, mode, /* extra_flags = */ 0, affected_jobs, e, ret);
}
int manager_add_job_by_name_and_warn(Manager *m, JobType type, const char *name, JobMode mode, Set *affected_jobs, Job **ret) {
diff --git a/src/core/manager.h b/src/core/manager.h
index abf02bf079..c1f7f8c083 100644
--- a/src/core/manager.h
+++ b/src/core/manager.h
@@ -139,6 +139,7 @@ typedef enum WatchdogType {
#include "job.h"
#include "path-lookup.h"
#include "show-status.h"
+#include "transaction.h"
#include "unit-name.h"
#include "unit.h"
@@ -554,9 +555,26 @@ int manager_load_unit(Manager *m, const char *name, const char *path, sd_bus_err
int manager_load_startable_unit_or_warn(Manager *m, const char *name, const char *path, Unit **ret);
int manager_load_unit_from_dbus_path(Manager *m, const char *s, sd_bus_error *e, Unit **_u);
-int manager_add_job(Manager *m, JobType type, Unit *unit, JobMode mode, Set *affected_jobs, sd_bus_error *e, Job **_ret);
-int manager_add_job_by_name(Manager *m, JobType type, const char *name, JobMode mode, Set *affected_jobs, sd_bus_error *e, Job **_ret);
-int manager_add_job_by_name_and_warn(Manager *m, JobType type, const char *name, JobMode mode, Set *affected_jobs, Job **ret);
+int manager_add_job_full(
+ Manager *m,
+ JobType type,
+ Unit *unit,
+ JobMode mode,
+ TransactionAddFlags extra_flags,
+ Set *affected_jobs,
+ sd_bus_error *error,
+ Job **ret);
+static inline int manager_add_job(
+ Manager *m,
+ JobType type,
+ Unit *unit,
+ JobMode mode,
+ sd_bus_error *error,
+ Job **ret) {
+ return manager_add_job_full(m, type, unit, mode, 0, NULL, error, ret);
+}
+int manager_add_job_by_name(Manager *m, JobType type, const char *name, JobMode mode, Set *affected_jobs, sd_bus_error *e, Job **ret);
+int manager_add_job_by_name_and_warn(Manager *m, JobType type, const char *name, JobMode mode, Set *affected_jobs, Job **ret);
int manager_propagate_reload(Manager *m, Unit *unit, JobMode mode, sd_bus_error *e);
void manager_clear_jobs(Manager *m);
diff --git a/src/core/path.c b/src/core/path.c
index 50f6db1470..e0dc93aabd 100644
--- a/src/core/path.c
+++ b/src/core/path.c
@@ -546,7 +546,7 @@ static void path_enter_running(Path *p, char *trigger_path) {
goto fail;
}
- r = manager_add_job(UNIT(p)->manager, JOB_START, trigger, JOB_REPLACE, NULL, &error, &job);
+ r = manager_add_job(UNIT(p)->manager, JOB_START, trigger, JOB_REPLACE, &error, &job);
if (r < 0) {
log_unit_warning(UNIT(p), "Failed to queue unit startup job: %s", bus_error_message(&error, r));
goto fail;
diff --git a/src/core/service.c b/src/core/service.c
index 03b9601be1..b9c12140d3 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -2647,11 +2647,10 @@ static void service_enter_restart(Service *s, bool shortcut) {
/* Any units that are bound to this service must also be restarted. We use JOB_START for ourselves
* but then set JOB_RESTART_DEPENDENCIES which will enqueue JOB_RESTART for those dependency jobs. */
- r = manager_add_job(UNIT(s)->manager, JOB_START, UNIT(s), JOB_RESTART_DEPENDENCIES, NULL, &error, NULL);
+ r = manager_add_job(UNIT(s)->manager, JOB_START, UNIT(s), JOB_RESTART_DEPENDENCIES, &error, /* ret = */ NULL);
if (r < 0) {
log_unit_warning(UNIT(s), "Failed to schedule restart job: %s", bus_error_message(&error, r));
- service_enter_dead(s, SERVICE_FAILURE_RESOURCES, /* allow_restart= */ false);
- return;
+ return service_enter_dead(s, SERVICE_FAILURE_RESOURCES, /* allow_restart= */ false);
}
/* Count the jobs we enqueue for restarting. This counter is maintained as long as the unit isn't
diff --git a/src/core/socket.c b/src/core/socket.c
index 8519aefa68..9b99ab2c35 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -2337,7 +2337,7 @@ static void socket_enter_running(Socket *s, int cfd_in) {
goto fail;
}
- r = manager_add_job(UNIT(s)->manager, JOB_START, UNIT_DEREF(s->service), JOB_REPLACE, NULL, &error, NULL);
+ r = manager_add_job(UNIT(s)->manager, JOB_START, UNIT_DEREF(s->service), JOB_REPLACE, &error, /* ret = */ NULL);
if (r < 0)
goto queue_error;
}
@@ -2405,7 +2405,7 @@ static void socket_enter_running(Socket *s, int cfd_in) {
s->n_connections++;
- r = manager_add_job(UNIT(s)->manager, JOB_START, service, JOB_REPLACE, NULL, &error, NULL);
+ r = manager_add_job(UNIT(s)->manager, JOB_START, service, JOB_REPLACE, &error, /* ret = */ NULL);
if (r < 0) {
/* We failed to activate the new service, but it still exists. Let's make sure the
* service closes and forgets the connection fd again, immediately. */
diff --git a/src/core/timer.c b/src/core/timer.c
index e44298d5e8..b37a67f310 100644
--- a/src/core/timer.c
+++ b/src/core/timer.c
@@ -618,7 +618,7 @@ static void timer_enter_running(Timer *t) {
goto fail;
}
- r = manager_add_job(UNIT(t)->manager, JOB_START, trigger, JOB_REPLACE, NULL, &error, &job);
+ r = manager_add_job(UNIT(t)->manager, JOB_START, trigger, JOB_REPLACE, &error, &job);
if (r < 0) {
log_unit_warning(UNIT(t), "Failed to queue unit startup job: %s", bus_error_message(&error, r));
goto fail;
diff --git a/src/core/transaction.h b/src/core/transaction.h
index 151e02dd60..f2bf047f10 100644
--- a/src/core/transaction.h
+++ b/src/core/transaction.h
@@ -2,6 +2,7 @@
#pragma once
typedef struct Transaction Transaction;
+typedef enum TransactionAddFlags TransactionAddFlags;
#include "hashmap.h"
#include "job.h"
@@ -10,14 +11,14 @@ typedef struct Transaction Transaction;
struct Transaction {
/* Jobs to be added */
- Hashmap *jobs; /* Unit object => Job object list 1:1 */
- Job *anchor_job; /* the job the user asked for */
+ Hashmap *jobs; /* Unit object => Job object list 1:1 */
+ Job *anchor_job; /* The job the user asked for */
bool irreversible;
};
-Transaction *transaction_new(bool irreversible);
-Transaction *transaction_free(Transaction *tr);
-Transaction *transaction_abort_and_free(Transaction *tr);
+Transaction* transaction_new(bool irreversible);
+Transaction* transaction_free(Transaction *tr);
+Transaction* transaction_abort_and_free(Transaction *tr);
DEFINE_TRIVIAL_CLEANUP_FUNC(Transaction*, transaction_abort_and_free);
typedef enum TransactionAddFlags {
@@ -31,13 +32,19 @@ typedef enum TransactionAddFlags {
/* Indicate that we're in the recursion for processing UNIT_ATOM_PROPAGATE_STOP_GRACEFUL units */
TRANSACTION_PROCESS_PROPAGATE_STOP_GRACEFUL = 1 << 5,
+
+ _TRANSACTION_FLAGS_MASK_PUBLIC = 0,
} TransactionAddFlags;
void transaction_add_propagate_reload_jobs(
Transaction *tr,
- Unit *unit, Job *by,
+ Unit *unit,
+ Job *by,
TransactionAddFlags flags);
+int transaction_add_isolate_jobs(Transaction *tr, Manager *m);
+int transaction_add_triggering_jobs(Transaction *tr, Unit *u);
+
int transaction_add_job_and_dependencies(
Transaction *tr,
JobType type,
@@ -47,5 +54,3 @@ int transaction_add_job_and_dependencies(
sd_bus_error *e);
int transaction_activate(Transaction *tr, Manager *m, JobMode mode, Set *affected, sd_bus_error *e);
-int transaction_add_isolate_jobs(Transaction *tr, Manager *m);
-int transaction_add_triggering_jobs(Transaction *tr, Unit *u);
diff --git a/src/core/unit.c b/src/core/unit.c
index dda98bb861..eec08a2fbf 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -2217,16 +2217,16 @@ static void retroactively_start_dependencies(Unit *u) {
UNIT_FOREACH_DEPENDENCY(other, u, UNIT_ATOM_RETROACTIVE_START_REPLACE) /* Requires= + BindsTo= */
if (!unit_has_dependency(u, UNIT_ATOM_AFTER, other) &&
!UNIT_IS_ACTIVE_OR_ACTIVATING(unit_active_state(other)))
- (void) manager_add_job(u->manager, JOB_START, other, JOB_REPLACE, NULL, NULL, NULL);
+ (void) manager_add_job(u->manager, JOB_START, other, JOB_REPLACE, /* error = */ NULL, /* ret = */ NULL);
UNIT_FOREACH_DEPENDENCY(other, u, UNIT_ATOM_RETROACTIVE_START_FAIL) /* Wants= */
if (!unit_has_dependency(u, UNIT_ATOM_AFTER, other) &&
!UNIT_IS_ACTIVE_OR_ACTIVATING(unit_active_state(other)))
- (void) manager_add_job(u->manager, JOB_START, other, JOB_FAIL, NULL, NULL, NULL);
+ (void) manager_add_job(u->manager, JOB_START, other, JOB_FAIL, /* error = */ NULL, /* ret = */ NULL);
UNIT_FOREACH_DEPENDENCY(other, u, UNIT_ATOM_RETROACTIVE_STOP_ON_START) /* Conflicts= (and inverse) */
if (!UNIT_IS_INACTIVE_OR_DEACTIVATING(unit_active_state(other)))
- (void) manager_add_job(u->manager, JOB_STOP, other, JOB_REPLACE, NULL, NULL, NULL);
+ (void) manager_add_job(u->manager, JOB_STOP, other, JOB_REPLACE, /* error = */ NULL, /* ret = */ NULL);
}
static void retroactively_stop_dependencies(Unit *u) {
@@ -2238,7 +2238,7 @@ static void retroactively_stop_dependencies(Unit *u) {
/* Pull down units which are bound to us recursively if enabled */
UNIT_FOREACH_DEPENDENCY(other, u, UNIT_ATOM_RETROACTIVE_STOP_ON_STOP) /* BoundBy= */
if (!UNIT_IS_INACTIVE_OR_DEACTIVATING(unit_active_state(other)))
- (void) manager_add_job(u->manager, JOB_STOP, other, JOB_REPLACE, NULL, NULL, NULL);
+ (void) manager_add_job(u->manager, JOB_STOP, other, JOB_REPLACE, /* error = */ NULL, /* ret = */ NULL);
}
void unit_start_on_termination_deps(Unit *u, UnitDependencyAtom atom) {
@@ -2269,7 +2269,7 @@ void unit_start_on_termination_deps(Unit *u, UnitDependencyAtom atom) {
if (n_jobs == 0)
log_unit_info(u, "Triggering %s dependencies.", dependency_name);
- r = manager_add_job(u->manager, JOB_START, other, job_mode, NULL, &error, NULL);
+ r = manager_add_job(u->manager, JOB_START, other, job_mode, &error, /* ret = */ NULL);
if (r < 0)
log_unit_warning_errno(u, r, "Failed to enqueue %s%s job, ignoring: %s",
dependency_name, other->id, bus_error_message(&error, r));
diff --git a/src/test/test-engine.c b/src/test/test-engine.c
index 0169f8320f..57774d04c5 100644
--- a/src/test/test-engine.c
+++ b/src/test/test-engine.c
@@ -106,7 +106,7 @@ int main(int argc, char *argv[]) {
manager_dump_units(m, stdout, /* patterns= */ NULL, "\t");
printf("Test1: (Trivial)\n");
- r = manager_add_job(m, JOB_START, c, JOB_REPLACE, NULL, &err, &j);
+ r = manager_add_job(m, JOB_START, c, JOB_REPLACE, &err, &j);
if (sd_bus_error_is_set(&err))
log_error("error: %s: %s", err.name, err.message);
assert_se(r == 0);
@@ -119,15 +119,15 @@ int main(int argc, char *argv[]) {
manager_dump_units(m, stdout, /* patterns= */ NULL, "\t");
printf("Test2: (Cyclic Order, Unfixable)\n");
- assert_se(manager_add_job(m, JOB_START, d, JOB_REPLACE, NULL, NULL, &j) == -EDEADLK);
+ assert_se(manager_add_job(m, JOB_START, d, JOB_REPLACE, NULL, &j) == -EDEADLK);
manager_dump_jobs(m, stdout, /* patterns= */ NULL, "\t");
printf("Test3: (Cyclic Order, Fixable, Garbage Collector)\n");
- assert_se(manager_add_job(m, JOB_START, e, JOB_REPLACE, NULL, NULL, &j) == 0);
+ assert_se(manager_add_job(m, JOB_START, e, JOB_REPLACE, NULL, &j) == 0);
manager_dump_jobs(m, stdout, /* patterns= */ NULL, "\t");
printf("Test4: (Identical transaction)\n");
- assert_se(manager_add_job(m, JOB_START, e, JOB_FAIL, NULL, NULL, &j) == 0);
+ assert_se(manager_add_job(m, JOB_START, e, JOB_FAIL, NULL, &j) == 0);
manager_dump_jobs(m, stdout, /* patterns= */ NULL, "\t");
printf("Load3:\n");
@@ -135,21 +135,21 @@ int main(int argc, char *argv[]) {
manager_dump_units(m, stdout, /* patterns= */ NULL, "\t");
printf("Test5: (Colliding transaction, fail)\n");
- assert_se(manager_add_job(m, JOB_START, g, JOB_FAIL, NULL, NULL, &j) == -EDEADLK);
+ assert_se(manager_add_job(m, JOB_START, g, JOB_FAIL, NULL, &j) == -EDEADLK);
printf("Test6: (Colliding transaction, replace)\n");
- assert_se(manager_add_job(m, JOB_START, g, JOB_REPLACE, NULL, NULL, &j) == 0);
+ assert_se(manager_add_job(m, JOB_START, g, JOB_REPLACE, NULL, &j) == 0);
manager_dump_jobs(m, stdout, /* patterns= */ NULL, "\t");
printf("Test7: (Unmergeable job type, fail)\n");
- assert_se(manager_add_job(m, JOB_STOP, g, JOB_FAIL, NULL, NULL, &j) == -EDEADLK);
+ assert_se(manager_add_job(m, JOB_STOP, g, JOB_FAIL, NULL, &j) == -EDEADLK);
printf("Test8: (Mergeable job type, fail)\n");
- assert_se(manager_add_job(m, JOB_RESTART, g, JOB_FAIL, NULL, NULL, &j) == 0);
+ assert_se(manager_add_job(m, JOB_RESTART, g, JOB_FAIL, NULL, &j) == 0);
manager_dump_jobs(m, stdout, /* patterns= */ NULL, "\t");
printf("Test9: (Unmergeable job type, replace)\n");
- assert_se(manager_add_job(m, JOB_STOP, g, JOB_REPLACE, NULL, NULL, &j) == 0);
+ assert_se(manager_add_job(m, JOB_STOP, g, JOB_REPLACE, NULL, &j) == 0);
manager_dump_jobs(m, stdout, /* patterns= */ NULL, "\t");
printf("Load4:\n");
@@ -157,7 +157,7 @@ int main(int argc, char *argv[]) {
manager_dump_units(m, stdout, /* patterns= */ NULL, "\t");
printf("Test10: (Unmergeable job type of auxiliary job, fail)\n");
- assert_se(manager_add_job(m, JOB_START, h, JOB_FAIL, NULL, NULL, &j) == 0);
+ assert_se(manager_add_job(m, JOB_START, h, JOB_FAIL, NULL, &j) == 0);
manager_dump_jobs(m, stdout, /* patterns= */ NULL, "\t");
printf("Load5:\n");
@@ -168,7 +168,7 @@ int main(int argc, char *argv[]) {
manager_dump_units(m, stdout, /* patterns= */ NULL, "\t");
printf("Test11: (Start/stop job ordering, execution cycle)\n");
- assert_se(manager_add_job(m, JOB_START, i, JOB_FAIL, NULL, NULL, &j) == 0);
+ assert_se(manager_add_job(m, JOB_START, i, JOB_FAIL, NULL, &j) == 0);
assert_se(unit_has_job_type(a, JOB_STOP));
assert_se(unit_has_job_type(d, JOB_STOP));
assert_se(unit_has_job_type(b, JOB_START));
@@ -181,7 +181,7 @@ int main(int argc, char *argv[]) {
manager_dump_units(m, stdout, /* patterns= */ NULL, "\t");
printf("Test12: (Trivial cycle, Unfixable)\n");
- assert_se(manager_add_job(m, JOB_START, a_conj, JOB_REPLACE, NULL, NULL, &j) == -EDEADLK);
+ assert_se(manager_add_job(m, JOB_START, a_conj, JOB_REPLACE, NULL, &j) == -EDEADLK);
manager_dump_jobs(m, stdout, /* patterns= */ NULL, "\t");
assert_se(!hashmap_get(unit_get_dependencies(a, UNIT_PROPAGATES_RELOAD_TO), b));