From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EAEB3C433DB for ; Thu, 4 Feb 2021 15:55:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B55D564F53 for ; Thu, 4 Feb 2021 15:55:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237553AbhBDPza (ORCPT ); Thu, 4 Feb 2021 10:55:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:36196 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237642AbhBDPyJ (ORCPT ); Thu, 4 Feb 2021 10:54:09 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 47C0864DA5; Thu, 4 Feb 2021 15:53:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612454007; bh=khs2i3o7OyLpByS4iRQitlaOIeP18Lqtszz7MVd7WSg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WCloZaO1gq9wEGgNOGoPV0d87TreZLfRu/7f/MA26tyjU+Ru6yMj8HTvUKCtqwpcB gJYP+dBHnNpx5QLBd+YZP1KhLVoLcZXgluQoewwozQsn565g4vIkH/nF8HYlt9bSJm /6K6Lg3RKKon6YUux3/YZCd2Zmfl3rm4eW2dNlOe5XdDsqTq+EIewXbyPr9wxBoyD1 X0XfE6f2ptOHJxzzfkkfdAjICiuDOCfTKXijzCDMRS0+s+SGlm/KPhzsbakn+x6/5b 5/5TU0WdJ/OBkqCnd/nZnsDrUmD713Pg3Mh2l2uzXFksuvJtb1nNwCKBKGUnZoviA1 SAM0go1xxT0jw== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 2F5C140513; Thu, 4 Feb 2021 12:53:24 -0300 (-03) Date: Thu, 4 Feb 2021 12:53:24 -0300 From: Arnaldo Carvalho de Melo To: Jiri Olsa Cc: Jiri Olsa , lkml , Peter Zijlstra , Ingo Molnar , Mark Rutland , Namhyung Kim , Alexander Shishkin , Michael Petlan , Ian Rogers , Stephane Eranian , Alexei Budankov Subject: Re: [PATCH 04/24] perf daemon: Add server socket support Message-ID: <20210204155324.GC910119@kernel.org> References: <20210129134855.195810-1-jolsa@redhat.com> <20210130234856.271282-1-jolsa@kernel.org> <20210130234856.271282-5-jolsa@kernel.org> <20210203210423.GQ854763@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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