Message ID | 20230106082314.2091-1-anothername27-unity@yahoo.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp709807wrt; Fri, 6 Jan 2023 00:24:28 -0800 (PST) X-Google-Smtp-Source: AMrXdXsYHqvBGKZEn1AWkcmLaG9H/faIsF80rjAQOVBRs9EFsB1XgvbQkVpAGuuceSymSMk+E8xb X-Received: by 2002:a17:906:5202:b0:7e4:1794:9031 with SMTP id g2-20020a170906520200b007e417949031mr45724862ejm.54.1672993468181; Fri, 06 Jan 2023 00:24:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672993468; cv=none; d=google.com; s=arc-20160816; b=mGyOSVNBZpKmV+6s1nj2jsBJEfujVMOdp5+uO0O9QfE+5/3GUdCQtyK9pAIbeA/Wc6 4E6vVvGIb052iBleblVlxpVqJccNrHaOoZdUGjKXwZM6RC587wIak4bMj5nsjGLn9s2l 8Y1Yp6BGQPWJ4Gi7AfjOZ6LcEG6exk8a/MeXql7+Qd+3yDAal3kHM2rCYahwUbRYcgYE /kBnS50+yyUS1jVYHE9tUUuJiFYANje/FJufbyRo3aKIyitpC/XKxgA5DJc+oBnstr4z hKFs7zkkCTjQEa9Bn/tc3JKsvpzJmyA4PoPueEjKresengVa6m+/bU4OpqVfJwmyRAj3 sZVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=CA4Y5Fc7xSHOujvlO3gjQKQ/zXsLpGAS4X2lAbgsv6I=; b=V2BCloLNK+L7efe+RvCe9kGj8ZjhUWJu7Z0vrMrTUQ3OKtbWbNCNui4LsG2DIsZkId osqEe6cuLMPB+4FO0lVSKcHTW0HYAV+RkG3Tgvx6I6jstDUMjAklr6URk2zj0+wWn7Ci 7//XFVu/ztiHscTeB9SU+eCczc9jUDWBrVOmF32uN1xHb5J3A+5gKuODqK/gyASQ+jB8 /dX/t1ZnLpjaXDpvLQCINebMzupVpHgB2TBCoAlbSEjj7qtId82NL0cAVvXYG1Rug+yz 4YhCyJtW4jfeMiSH4chwzxwmIc0Wyw8S0ru1yWNZQZDzDrvcpKATNd1ZtKaJOulrFNDR pOnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ORQOwR8Z; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id wu1-20020a170906eec100b007ade4c97618si666832ejb.930.2023.01.06.00.24.28 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jan 2023 00:24:28 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ORQOwR8Z; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3EFCA385840A for <ouuuleilei@gmail.com>; Fri, 6 Jan 2023 08:24:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3EFCA385840A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1672993467; bh=CA4Y5Fc7xSHOujvlO3gjQKQ/zXsLpGAS4X2lAbgsv6I=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ORQOwR8ZbPNk5DCbkO+Vjo5rGG+dv+olQbrXxN39L/n12mDbS7KYXv9kxLX33h8EP qaaDpj85FJsi5v7/kvpl+BqAjlp0/Y57hTyBy+zf6WXKTKyC4xjIGGXabhy7NzbXF7 mEp1miN9bnm+Ip0kUyUVWD3qMJumhc1XVqtM4/J0= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from sonic317-34.consmr.mail.ne1.yahoo.com (sonic317-34.consmr.mail.ne1.yahoo.com [66.163.184.45]) by sourceware.org (Postfix) with ESMTPS id 05FB63858D28 for <gcc-patches@gcc.gnu.org>; Fri, 6 Jan 2023 08:23:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 05FB63858D28 X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1672993421; bh=W/GrviHMpnSp3QUwc1QGvnEkBI4tN2Hut2uqyjxGT1j=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=IFgmU3LeAEn7rFPOf3rOnmVce8BT9mR7A7uaEstTuqKTOugafPCsDjkJVLuq5nOWsco+A/g2hnW3nERa3OcBHUNxPTmLFA2xkie8nKiTng9cWV9EjlU8BNG9kC0MlfMLd5jvIHFt+af6Mv7ViwMH7Q6vHFCdcyK3ANmof5P36LgJoth/u2EtzhQK73Mb4C1N0LpXkGfdm2t0YduiIlS3jk3Oe17xsZ5W3ONjRJUE5VvmYqdx1ffvqbqHQ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0c_0UNthUBcuSLoxO1iEjETLdXjnW0i7z9ReJDtuUjfPPGW2L_A2ReU42s21 YyBBDawUpJUjNdrBYPX6AOnYO4.m9fRlTUtDIXHmdKlgivi86HD6chJLYe8VOV9uyvSyq3dvvOgE c7MykdDdHSU_Cf6mrw16vlYV6pXGklir55yvo0nIBWQuKywpYe2e8SDxmsqiw5MGObPHmz8UgQPk nPXVTwB2b_5D7h3rL7Tv3q1rMv0KeDCShYKC2RqGV5lU- X-Sonic-MF: <himalr@yahoo.com> Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.ne1.yahoo.com with HTTP; Fri, 6 Jan 2023 08:23:41 +0000 Received: by hermes--production-ne1-7b69748c4d-dzr9v (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID c669b6f739b0b735d99cf157a2be4812; Fri, 06 Jan 2023 08:23:40 +0000 (UTC) To: gcc-patches@gcc.gnu.org, himalr@proton.me Subject: [PATCH] Handle Windows nul device in unlink-if-ordinary.c Date: Fri, 6 Jan 2023 13:53:14 +0530 Message-Id: <20230106082314.2091-1-anothername27-unity@yahoo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <fNaJU0FQkpY1sbMSTBhtyL9Fe3rKjTMaPdqQoq0VZhJBQxB1UtH_QU19Rai4usWKkETmSjqNT7cW5JaJxPnLy6iDTYpq4LHcEZsk2twCHAE=@proton.me> References: <fNaJU0FQkpY1sbMSTBhtyL9Fe3rKjTMaPdqQoq0VZhJBQxB1UtH_QU19Rai4usWKkETmSjqNT7cW5JaJxPnLy6iDTYpq4LHcEZsk2twCHAE=@proton.me> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: anothername27-unity--- via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: anothername27-unity@yahoo.com Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754260799037711990?= X-GMAIL-MSGID: =?utf-8?q?1754260799037711990?= |
Series |
Handle Windows nul device in unlink-if-ordinary.c
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Li, Pan2 via Gcc-patches
Jan. 6, 2023, 8:23 a.m. UTC
From: Himal <himalr@proton.me>
Hi,
This might be a better fix.
Thanks.
---
libiberty/unlink-if-ordinary.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libiberty/unlink-if-ordinary.c b/libiberty/unlink-if-ordinary.c index 84328b216..e765ac8b1 100644 --- a/libiberty/unlink-if-ordinary.c +++ b/libiberty/unlink-if-ordinary.c @@ -62,6 +62,12 @@ was made to unlink the file because it is special. int unlink_if_ordinary (const char *name) { +/* MS-Windows 'stat' function (and in turn, S_ISREG) + reports the null device as a regular file. */ +#ifdef _WIN32 + if (stricmp (name, "nul") == 0) + return 1; +#endif struct stat st; if (lstat (name, &st) == 0