summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorŁukasz Stelmach <l.stelmach@samsung.com>2024-04-25 16:10:49 +0200
committerDaan De Meyer <daan.j.demeyer@gmail.com>2024-04-25 18:24:36 +0200
commite85be4983d974063b5210e6df77d9109ffbc9932 (patch)
treee55591137e35d828d8ebeab8fc71b436cec23b75 /src
parentMerge pull request #32477 from DaanDeMeyer/fixes (diff)
downloadsystemd-e85be4983d974063b5210e6df77d9109ffbc9932.tar.xz
systemd-e85be4983d974063b5210e6df77d9109ffbc9932.zip
Fix _do_log conditions in log_exec_* macros
The expression for calculation of the _do_log values in the log_exec_* macros need to be the same as the unit_log_level_test() function, used to calculate _do_log in unit.h. The only difference between execute.h and unit.h is the lack of the Unit structure. Fixes: b646fc324a ("core: ensure execute/spawn functions can work without Unit object") Fixes: 210ca71cb5 ("core/execute: clean up log_exec_full_errno and friends") Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
Diffstat (limited to 'src')
-rw-r--r--src/core/execute.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/execute.h b/src/core/execute.h
index 6a313640de..0719d3904a 100644
--- a/src/core/execute.h
+++ b/src/core/execute.h
@@ -634,8 +634,8 @@ bool exec_needs_ipc_namespace(const ExecContext *context);
const ExecContext *_c = (ec); \
const ExecParameters *_p = (ep); \
const int _l = (level); \
- bool _do_log = _c->log_level_max >= 0 && \
- _c->log_level_max < LOG_PRI(_l); \
+ bool _do_log = _c->log_level_max < 0 || \
+ _c->log_level_max >= LOG_PRI(_l); \
LOG_CONTEXT_PUSH_IOV(_c->log_extra_fields, \
_c->n_log_extra_fields); \
!_do_log ? -ERRNO_VALUE(error) : \
@@ -672,8 +672,8 @@ bool exec_needs_ipc_namespace(const ExecContext *context);
const ExecContext *_c = (ec); \
const ExecParameters *_p = (ep); \
const int _l = (level); \
- bool _do_log = _c->log_level_max >= 0 && \
- _c->log_level_max < LOG_PRI(_l); \
+ bool _do_log = _c->log_level_max < 0 || \
+ _c->log_level_max >= LOG_PRI(_l); \
LOG_CONTEXT_PUSH_IOV(_c->log_extra_fields, \
_c->n_log_extra_fields); \
!_do_log ? -ERRNO_VALUE(error) : \