Tarantool development patches archive
 help / color / mirror / Atom feed
From: Alexander Turenko <alexander.turenko@tarantool.org>
To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 04/13] popen: add logging of fds closed in a child
Date: Fri, 10 Apr 2020 15:19:38 +0300	[thread overview]
Message-ID: <20200410121938.hfuhisypbgmhhdbu@tkn_work_nb> (raw)
In-Reply-To: <20200410074642.GI3072@uranus>

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 <gorcunov@gmail.com>
> 
> > ---
> >  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);

  reply	other threads:[~2020-04-10 12:19 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-10  2:50 [Tarantool-patches] [PATCH 00/13] Popen Lua API: preliminary patches Alexander Turenko
2020-04-10  2:50 ` [Tarantool-patches] [PATCH 01/13] popen: require popen handle to be non-NULL Alexander Turenko
2020-04-10  7:16   ` Cyrill Gorcunov
2020-04-10  2:50 ` [Tarantool-patches] [PATCH 02/13] popen: remove retval from popen_state() Alexander Turenko
2020-04-10  7:17   ` Cyrill Gorcunov
2020-04-10  2:50 ` [Tarantool-patches] [PATCH 03/13] popen: add missed diag_set in popen_signal/delete Alexander Turenko
2020-04-10  7:23   ` Cyrill Gorcunov
2020-04-10  2:50 ` [Tarantool-patches] [PATCH 04/13] popen: add logging of fds closed in a child Alexander Turenko
2020-04-10  7:46   ` Cyrill Gorcunov
2020-04-10 12:19     ` Alexander Turenko [this message]
2020-04-10  2:50 ` [Tarantool-patches] [PATCH 05/13] say: allow to set a logger file descriptor Alexander Turenko
2020-04-10  8:33   ` Cyrill Gorcunov
2020-04-10 12:19     ` Alexander Turenko
2020-04-10  2:50 ` [Tarantool-patches] [PATCH 06/13] popen: decouple logger fd from stderr Alexander Turenko
2020-04-10  9:18   ` Cyrill Gorcunov
2020-04-10 12:20     ` Alexander Turenko
2020-04-10  2:50 ` [Tarantool-patches] [PATCH 07/13] popen: add const qualifier to popen_write_timeout Alexander Turenko
2020-04-10  8:04   ` Cyrill Gorcunov
2020-04-10  2:50 ` [Tarantool-patches] [PATCH 08/13] popen: unblock popen_read_timeout at a first byte Alexander Turenko
2020-04-10  8:10   ` Cyrill Gorcunov
2020-04-10  2:50 ` [Tarantool-patches] [PATCH 09/13] popen: remove redundant fd check before perform IO Alexander Turenko
2020-04-10  8:18   ` Cyrill Gorcunov
2020-04-10  2:50 ` [Tarantool-patches] [PATCH 10/13] popen: add missed diag_set() in popen IO functions Alexander Turenko
2020-04-10  8:28   ` Cyrill Gorcunov
2020-04-10  2:50 ` [Tarantool-patches] [PATCH 11/13] coio: fix obsoleted comment in coio_write_timeout Alexander Turenko
2020-04-10  8:28   ` Cyrill Gorcunov
2020-04-10  2:50 ` [Tarantool-patches] [PATCH 12/13] coio: add *_noxc read / write functions Alexander Turenko
2020-04-10  8:05   ` Konstantin Osipov
2020-04-10  8:17     ` Cyrill Gorcunov
2020-04-10 11:57     ` Alexander Turenko
2020-04-12 12:51     ` Alexander Turenko
2020-04-10  8:29   ` Cyrill Gorcunov
2020-04-10  2:50 ` [Tarantool-patches] [PATCH 13/13] popen: use of exception safe functions for IO Alexander Turenko
2020-04-10 11:50   ` Cyrill Gorcunov
2020-04-10 12:21     ` Alexander Turenko
2020-04-10 16:36 ` [Tarantool-patches] [PATCH 00/13] Popen Lua API: preliminary patches Kirill Yukhin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200410121938.hfuhisypbgmhhdbu@tkn_work_nb \
    --to=alexander.turenko@tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 04/13] popen: add logging of fds closed in a child' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox