core/unit: clean up duplicate conditions
This commit is contained in:
+5
-11
@@ -1293,18 +1293,8 @@ int unit_add_exec_dependencies(Unit *u, ExecContext *c) {
|
||||
return r;
|
||||
}
|
||||
|
||||
if (!IN_SET(c->std_output,
|
||||
EXEC_OUTPUT_JOURNAL, EXEC_OUTPUT_JOURNAL_AND_CONSOLE,
|
||||
EXEC_OUTPUT_KMSG, EXEC_OUTPUT_KMSG_AND_CONSOLE) &&
|
||||
!IN_SET(c->std_error,
|
||||
EXEC_OUTPUT_JOURNAL, EXEC_OUTPUT_JOURNAL_AND_CONSOLE,
|
||||
EXEC_OUTPUT_KMSG, EXEC_OUTPUT_KMSG_AND_CONSOLE) &&
|
||||
!c->log_namespace)
|
||||
return 0;
|
||||
|
||||
/* If syslog or kernel logging is requested (or log namespacing is), make sure our own logging daemon
|
||||
* is run first. */
|
||||
|
||||
if (c->log_namespace) {
|
||||
static const struct {
|
||||
const char *template;
|
||||
@@ -1326,7 +1316,11 @@ int unit_add_exec_dependencies(Unit *u, ExecContext *c) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
} else {
|
||||
} else if (IN_SET(c->std_output, EXEC_OUTPUT_JOURNAL, EXEC_OUTPUT_JOURNAL_AND_CONSOLE,
|
||||
EXEC_OUTPUT_KMSG, EXEC_OUTPUT_KMSG_AND_CONSOLE) ||
|
||||
IN_SET(c->std_error, EXEC_OUTPUT_JOURNAL, EXEC_OUTPUT_JOURNAL_AND_CONSOLE,
|
||||
EXEC_OUTPUT_KMSG, EXEC_OUTPUT_KMSG_AND_CONSOLE)) {
|
||||
|
||||
r = unit_add_dependency_by_name(u, UNIT_AFTER, SPECIAL_JOURNALD_SOCKET, true, UNIT_DEPENDENCY_FILE);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
Reference in New Issue
Block a user