From patchwork Thu Sep 23 11:36:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 45350 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9B0EF3857C4C for ; Thu, 23 Sep 2021 11:36:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9B0EF3857C4C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1632396998; bh=sTOLr+1E4G8yaWcoHsUBIJQcj3Zrsm+hGTgKBfR/LFo=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=icS0r0JHWW9vc0ISMLlV3SYHqo9IRrxhKQeMOttdKCiTNJ1bkLdLtCZxhJpFfoMEY 1GGHMLYYh+1W6pf2rAAIRISggKhpy8jE0C9W77y5vO81w9tJsqORBU6uPOLLCUB4OU 5MdjJZ3uRdCB/w2Ww8kmY+nGc3wb4hZLWPG+OI7k= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 2E83A3858D39 for ; Thu, 23 Sep 2021 11:36:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2E83A3858D39 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-247-QyeEdygiM1a_pYzNW9VJaQ-1; Thu, 23 Sep 2021 07:36:13 -0400 X-MC-Unique: QyeEdygiM1a_pYzNW9VJaQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D7DD81966323 for ; Thu, 23 Sep 2021 11:36:12 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.176]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0C562652A1 for ; Thu, 23 Sep 2021 11:36:11 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH] Linux: Avoid closing -1 on failure in __closefrom_fallback Date: Thu, 23 Sep 2021 13:36:10 +0200 Message-ID: <87v92rr0b9.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" --- sysdeps/unix/sysv/linux/closefrom_fallback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: H.J. Lu diff --git a/sysdeps/unix/sysv/linux/closefrom_fallback.c b/sysdeps/unix/sysv/linux/closefrom_fallback.c index 9cca55653a..f215fd2c09 100644 --- a/sysdeps/unix/sysv/linux/closefrom_fallback.c +++ b/sysdeps/unix/sysv/linux/closefrom_fallback.c @@ -48,7 +48,7 @@ __closefrom_fallback (int from, _Bool dirfd_fallback) dirfd = __open_nocancel (FD_TO_FILENAME_PREFIX, O_RDONLY | O_DIRECTORY, 0); if (dirfd == -1) - goto err; + return false; } char buffer[1024];