From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp47.i.mail.ru (smtp47.i.mail.ru [94.100.177.107]) (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 159164696C3 for ; Fri, 10 Apr 2020 15:19:40 +0300 (MSK) Date: Fri, 10 Apr 2020 15:19:38 +0300 From: Alexander Turenko Message-ID: <20200410121938.hfuhisypbgmhhdbu@tkn_work_nb> References: <20200410074642.GI3072@uranus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200410074642.GI3072@uranus> Subject: Re: [Tarantool-patches] [PATCH 04/13] popen: add logging of fds closed in a child List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cyrill Gorcunov Cc: tarantool-patches@dev.tarantool.org On Fri, Apr 10, 2020 at 10:46:42AM +0300, Cyrill Gorcunov wrote: > On Fri, Apr 10, 2020 at 05:50:42AM +0300, Alexander Turenko wrote: > > It is useful for debugging popen behaviour around file descriptors. > > > > Part of #4031 > Acked-by: Cyrill Gorcunov > > > --- > > src/lib/core/popen.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/src/lib/core/popen.c b/src/lib/core/popen.c > > index 3fcbc325a..9d4e6ef3a 100644 > > --- a/src/lib/core/popen.c > > +++ b/src/lib/core/popen.c > > @@ -579,6 +579,8 @@ close_inherited_fds(int *skip_fds, size_t nr_skip_fds) > > if (fd_no == -1) > > continue; > > > > + say_debug("popen: close inherited fd [%s:%d]", stdX_str(fd_no), > > + fd_no); > > Can we please shift args a bit, like > > say_debug("popen: close inherited fd [%s:%d]", > stdX_str(fd_no), fd_no); My approach is to keep lines within 80 symbols, but don't break lines prematurely. I asked Cyrill what is the general approach he use, because I don't want change code back and forth due to different styles within one file. The answer is that one dangling word looks ugly. It is not strict criteria, however I will try to follow it (at least when editing Cyrill's code). Changed: diff --git a/src/lib/core/popen.c b/src/lib/core/popen.c index 9d4e6ef3a..e5e7e5cfc 100644 --- a/src/lib/core/popen.c +++ b/src/lib/core/popen.c @@ -579,8 +579,8 @@ close_inherited_fds(int *skip_fds, size_t nr_skip_fds) if (fd_no == -1) continue; - say_debug("popen: close inherited fd [%s:%d]", stdX_str(fd_no), - fd_no); + say_debug("popen: close inherited fd [%s:%d]", + stdX_str(fd_no), fd_no); if (close(fd_no)) { int saved_errno = errno; diag_set(SystemError, "fdin: Can't close %d", fd_no);