[patches] Re: [commits] [tarantool] 01/01: say: Fix multiple loggers patch

Konstantin Osipov kostja at tarantool.org
Thu Jan 25 11:55:49 MSK 2018


* IlyaMarkovMipt <markovilya197 at gmail.com> [18/01/24 13:19]:

> This is an automated email from the git hooks/post-receive script.
> 
> IlyaMarkovMipt pushed a commit to branch gh-3066-fix-syslog-behavior-change
> in repository tarantool.
> 
> commit eb85ec00f2e118027184216cf066ed6ecf9d31d4
> Author: IlyaMarkovMipt <markovilya197 at gmail.com>
> AuthorDate: Mon Jan 15 14:37:02 2018 +0300
> 
>     say: Fix multiple loggers patch
>     
>     * Fix changing the behavior of the syslog write:
>     It used to log to stderr only if level was S_FATAL and file
>     * descriptor is not stderr. After multi loggers patch it logs to
>     stderr on every logger call.
>     
>     Relates #3066
> ---
>  src/say.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/say.c b/src/say.c
> index 65c1872..0c151b8 100644
> --- a/src/say.c
> +++ b/src/say.c
> @@ -999,6 +999,9 @@ log_vsay(struct log *log, int level, const char *filename, int line,
>  		break;
>  	case SAY_LOGGER_SYSLOG:
>  		write_to_syslog(log, total);
> +		if (level == S_FATAL && log->fd != STDERR_FILENO)
> +			(void) write(STDERR_FILENO, buf, total);
> +		break;
>  	case SAY_LOGGER_BOOT:
>  		(void) write(STDERR_FILENO, buf, total);
>  		break;

How on earth log->fd can be equal to STDERR_FILENO if logging to
syslog?


-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.org - www.twitter.com/kostja_osipov



More information about the Tarantool-patches mailing list