Re: [PATCH 04/24] perf daemon: Add server socket support

From: Arnaldo Carvalho de Melo
Date: Thu Feb 04 2021 - 10:55:34 EST


Em Thu, Feb 04, 2021 at 03:49:36PM +0100, Jiri Olsa escreveu:
> On Wed, Feb 03, 2021 at 06:04:23PM -0300, Arnaldo Carvalho de Melo wrote:
> > Em Sun, Jan 31, 2021 at 12:48:36AM +0100, Jiri Olsa escreveu:
> > > +static int setup_server_socket(struct daemon *daemon)
> > > +{
> > > + struct sockaddr_un addr;
> > > + char path[100];
> > > + int fd;
> > > +
> > > + fd = socket(AF_UNIX, SOCK_STREAM, 0);
> >
> > Minor, combine decl with use, since line isn't long and its one after
> > the other, i.e.:
> >
> > int fd = socket(AF_UNIX, SOCK_STREAM, 0);
>
> hum, sure, but I'm missing the point.. I think it's less readable

one line instead of three :-)

> >
> > > + if (fd < 0) {
> > > + fprintf(stderr, "socket: %s\n", strerror(errno));
> > > + return -1;

- Arnaldo