Fix an error on dlog-redirection 07/289907/2
authorJunghak Sung <jh1009.sung@samsung.com>
Wed, 15 Mar 2023 07:39:30 +0000 (16:39 +0900)
committerMichal Bloch <m.bloch@partner.samsung.com>
Wed, 15 Mar 2023 11:07:11 +0000 (11:07 +0000)
When both stdout and stderr are set as dlog, log tag and priority of
stderr is not set properly.

Change-Id: Ia14de6aeff3828aa0d6a27210fa96c53ee577c8d
Signed-off-by: Junghak Sung <jh1009.sung@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/core/execute.c

index b8eff40..44877b4 100644 (file)
@@ -567,6 +567,10 @@ static bool can_inherit_stderr_from_stdout(
         if (IN_SET(e, EXEC_OUTPUT_FILE, EXEC_OUTPUT_FILE_APPEND))
                 return streq_ptr(context->stdio_file[STDOUT_FILENO], context->stdio_file[STDERR_FILENO]);
 
+        /* Returns false if STDERR output is redirected to dlog */
+        if (IN_SET(e, EXEC_OUTPUT_DLOG, EXEC_OUTPUT_DLOG_OR_NULL, EXEC_OUTPUT_DLOG_OR_KMSG, EXEC_OUTPUT_DLOG_OR_JOURNAL))
+                return false;
+
         return true;
 }