From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp49.i.mail.ru (smtp49.i.mail.ru [94.100.177.109]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id BCBB04696C4 for ; Fri, 10 Apr 2020 05:51:12 +0300 (MSK) From: Alexander Turenko Date: Fri, 10 Apr 2020 05:50:43 +0300 Message-Id: <04087d1f6a6bab4087b37d831b5fdfb9666b2605.1586486220.git.alexander.turenko@tarantool.org> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 05/13] say: allow to set a logger file descriptor List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cyrill Gorcunov Cc: tarantool-patches@dev.tarantool.org It is necessary to decouple stderr from a logger file descriptor in the popen implementation. Part of #4031 --- src/lib/core/say.c | 6 ++++++ src/lib/core/say.h | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/lib/core/say.c b/src/lib/core/say.c index dd05285a6..5d572e1ab 100644 --- a/src/lib/core/say.c +++ b/src/lib/core/say.c @@ -174,6 +174,12 @@ log_get_fd(void) return log_default->fd; } +void +log_set_fd(int new_fd) +{ + log_default->fd = new_fd; +} + void log_set_level(struct log *log, enum say_level level) { diff --git a/src/lib/core/say.h b/src/lib/core/say.h index e17de659c..3ce7724c4 100644 --- a/src/lib/core/say.h +++ b/src/lib/core/say.h @@ -204,10 +204,15 @@ enum say_logger_type log_type(); /** - * Default logger file descriptor. + * Accessors for default logger file descriptor. + * + * It is needed for dark magic inside popen implementation. + * Unlikely it is what you want to use anywhere else. */ int log_get_fd(void); +void +log_set_fd(int new_fd); /** * Set log level. Can be used dynamically. -- 2.25.0