From patchwork Tue Feb 11 10:22:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rolf Eike Beer X-Patchwork-Id: 11375169 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 11E33921 for ; Tue, 11 Feb 2020 10:23:10 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7FCBA20714 for ; Tue, 11 Feb 2020 10:23:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="JEUCdBLg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7FCBA20714 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=emlix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 4491484C; Tue, 11 Feb 2020 11:22:25 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4491484C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1581416587; bh=juDTutxUmTbKNKmp9kzSP5vpDsX8vA0WT4r+4E8UJZE=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=JEUCdBLgyMvSo+pySGUMV70Cp701OK3uo9lGKeyOb6Gbsd/L12FnDRPTYOsIgz4FU YpT1FmneqIJIbeXo6hU/4A+VK0K5nvVwfLsOJTzvUGI1NsSQpWb6TZ70y8uxNlp3P3 kuACNg9tlL97xJSi2EjEeutxYgfJSd3EsC9zjPXk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D71ECF8013E; Tue, 11 Feb 2020 11:22:24 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 04411F80145; Tue, 11 Feb 2020 11:22:23 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mx1.emlix.com (mx1.emlix.com [188.40.240.192]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 81F9BF800E7; Tue, 11 Feb 2020 11:22:19 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 81F9BF800E7 Received: from mailer.emlix.com (unknown [81.20.119.6]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.emlix.com (Postfix) with ESMTPS id B53CB5FB81; Tue, 11 Feb 2020 11:22:18 +0100 (CET) From: Rolf Eike Beer To: patch@alsa-project.org Date: Tue, 11 Feb 2020 11:22:18 +0100 Message-ID: <5948808.FfnTCzJfH2@devpool35> Organization: emlix GmbH MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH] do not set close-on-exec flag on descriptor if it was already set X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" There is no need to set this again if O_CLOEXEC is supported. Signed-off-by: Rolf Eike Beer --- include/local.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/local.h b/include/local.h index ea0ec32d..ed6ba936 100644 --- a/include/local.h +++ b/include/local.h @@ -320,8 +320,10 @@ static inline int snd_open_device(const char *filename, int fmode) fd = rsm_open_device(filename, fmode); } #endif +#ifndef O_CLOEXEC if (fd >= 0) fcntl(fd, F_SETFD, FD_CLOEXEC); +#endif return fd; }