From 9996f39b1d9d581fcb810dc0b031613637cd2f5d Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Tue, 23 Jun 2020 10:21:15 +0900 Subject: Check the error value Before printing error logs If the error value is -ENOENT(No such file or directory), the process doesn't print the error logs. Change-Id: I15548f966b4c28928f0f460c4be5a611df57503d Signed-off-by: Hwankyu Jhun --- src/common/src/launchpad_common.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/src/launchpad_common.c b/src/common/src/launchpad_common.c index d2bf965..fdb2455 100644 --- a/src/common/src/launchpad_common.c +++ b/src/common/src/launchpad_common.c @@ -950,7 +950,8 @@ static int __redirect_stdout(const char *ident) fd = sd_journal_stream_fd(ident, LOG_INFO, 0); if (fd < 0) { - _W("sd_journal_stream_fd() is failed. error(%d)", fd); + if (fd != -ENOENT) + _W("sd_journal_stream_fd() is failed. error(%d)", fd); return fd; } @@ -969,7 +970,8 @@ static int __redirect_stderr(const char *ident) fd = sd_journal_stream_fd(ident, LOG_WARNING, 0); if (fd < 0) { - _W("sd_journal_stream_fd() is failed. error(%d)", fd); + if (fd != -ENOENT) + _W("sd_journal_stream_fd() is failed. error(%d)", fd); return fd; } -- cgit v1.2.3