lkml.org 
[lkml]   [2013]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 05/11] [CLEANUP] trace-cmd: Split out the connect waiting loop from do_listen()
On Mon, 19 Aug 2013 18:46:32 +0900
Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com> wrote:

> Split out the connect waiting loop from do_listen() for avoiding duplicate codes
> between listen mode and virt-server mode.
>
> Signed-off-by: Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
> ---
> trace-listen.c | 45 ++++++++++++++++++++++++++-------------------
> 1 file changed, 26 insertions(+), 19 deletions(-)
>
> diff --git a/trace-listen.c b/trace-listen.c
> index 6c1bcac..c741fa4 100644
> --- a/trace-listen.c
> +++ b/trace-listen.c
> @@ -580,14 +580,35 @@ static void clean_up(int sig)
> } while (ret > 0);
> }
>
> +static void do_accept_loop(int sfd)
> +{
> + struct sockaddr_storage peer_addr;
> + socklen_t peer_addr_len;
> + int cfd, pid;

Just an FYI, and I don't really care too much. But my personal
preference, is to only join variables that are being used the same way.
That is, multiple file descriptors sure:

int sfd, s, cfd;

But I prefer to keep file descriptors separate from pid.

int cfd;
int pid;

But as I said, this is only a preference and I don't really care that
much about it to even bother to change the patch.

-- Steve


\
 
 \ /
  Last update: 2013-08-20 19:41    [W:0.205 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site