lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 20 Aug 2013 13:18:15 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@...achi.com>
Cc:	Hidehiro Kawai <hidehiro.kawai.ez@...achi.com>,
	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
	linux-kernel@...r.kernel.org, yrl.pp-manager.tt@...achi.com
Subject: Re: [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@...achi.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@...achi.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;
> +
> +	peer_addr_len = sizeof(peer_addr);
> +
> +	do {
> +		cfd = accept(sfd, (struct sockaddr *)&peer_addr,
> +			     &peer_addr_len);

I'm also not that strict on the 80 character limit. This is fine, but
so is one line. If you go over a few characters, it's not the end of
the world. Like, by joining this line, it's only 81 characters.

-- Steve

> +		printf("connected!\n");
> +		if (cfd < 0 && errno == EINTR)
> +			continue;
> +		if (cfd < 0)
> +			pdie("connecting");
> +
> +		pid = do_connection(cfd, &peer_addr, peer_addr_len);
> +		if (pid > 0)
> +			add_process(pid);
> +
> +	} while (!done);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ