From patchwork Mon Nov 16 04:38:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Andris_Pav=C4=93nis?= X-Patchwork-Id: 544896 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id F0DC41402DD for ; Mon, 16 Nov 2015 15:38:32 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=MgEDXsGC; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=V/E9d3ehpFD0kw5Hx Xk7DW0T7BzD582+VRAErCWUpydFmcNL5ZwZuLec5ha9CYRVOQr/xlLg0iyQ/pSTV 5SVgxo6cWfz8M0G2RkClKHjKk3ypEDAiMwP1zGbsBmwjQGnZ2KRL7m+k6ls5eSDw e+JeyrBm3hXGdFQGC4jOcWDEXQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=okkltXl/7M/AWe2xdsa59Ve 8vhg=; b=MgEDXsGC5jKI5kyOqy/GZSayWlhbj8um7iMvZTyGH8BOLsO3OEDvxLL xFHw4X0TT0Krr6gkwbVfdZ3eIdDiFF0lfNF+tJEks14V8PEf/5rwXxeMouIv5sF0 xTQcavRm97zY3+TKQlfQGo/w13bPS9+b8qj97vF4vHnTY+m444pM= Received: (qmail 10903 invoked by alias); 16 Nov 2015 04:38:23 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 10893 invoked by uid 89); 16 Nov 2015 04:38:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.9 required=5.0 tests=AWL, BAYES_50, RCVD_IN_DNSWL_NONE, SPF_NEUTRAL autolearn=no version=3.3.2 X-HELO: julia1.inet.fi Received: from mta-out1.inet.fi (HELO julia1.inet.fi) (62.71.2.234) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 16 Nov 2015 04:38:20 +0000 Received: from ap.localhost.localdomain (84.249.219.59) by julia1.inet.fi (9.0.002.03-2-gbe5d057) (authenticated as pavean-2) id 5613C7B1010FB34B; Mon, 16 Nov 2015 06:36:43 +0200 Subject: Re: [PATCH][DJGPP][libgfortran] Do not use S_ISVTX for DJGPP in libfortran/intrinsic/chmod.c To: Andreas Schwab References: <5648CB8A.9050407@iki.fi> <87d1vbgjf1.fsf@igel.home> Cc: GCC Patches , DJ Delorie From: Andris Pavenis Message-ID: <56495DB5.8040104@iki.fi> Date: Mon, 16 Nov 2015 06:38:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <87d1vbgjf1.fsf@igel.home> On 11/15/2015 09:19 PM, Andreas Schwab wrote: > Andris Pavenis writes: > >> diff --git a/libgfortran/intrinsics/chmod.c b/libgfortran/intrinsics/chmod.c >> index 1fffa3d..482a8a6 100644 >> --- a/libgfortran/intrinsics/chmod.c >> +++ b/libgfortran/intrinsics/chmod.c >> @@ -451,7 +451,7 @@ clause_done: >> if ((ugo[2] || honor_umask) && !rwxXstugo[8]) >> file_mode = (file_mode & ~(S_IROTH | S_IWOTH | S_IXOTH)) >> | (new_mode & (S_IROTH | S_IWOTH | S_IXOTH)); >> -#ifndef __VXWORKS__ >> +#if !defined(__VXWORKS__) && !defined(__DJGPP__) > How about making that #ifdef S_ISVTX? > > Andreas. > New patch attached. It is OK for DJGPP. Let us only hope that we have no some obscure target for which S_ISVTX is present but is not a preprocessor macro. I have no way of checking for all targets. From that point of view original patch was safer. Andris 2015-11-16 Andris Pavenis * libgfortran/intrinsics/chmod.c: use S_ISVTX only when it is defined From 6fcff7721ce292df7889797f1380d5313e445c6f Mon Sep 17 00:00:00 2001 From: Andris Pavenis Date: Mon, 16 Nov 2015 06:33:14 +0200 Subject: [PATCH] libgfortran/intrinsics/chmod.c: use S_ISVTX only when it is defined 2015-11-16 Andris Pavenis * libgfortran/intrinsics/chmod.c: use S_ISVTX only when it is defined --- libgfortran/intrinsics/chmod.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libgfortran/intrinsics/chmod.c b/libgfortran/intrinsics/chmod.c index 1fffa3d..f8eed17 100644 --- a/libgfortran/intrinsics/chmod.c +++ b/libgfortran/intrinsics/chmod.c @@ -451,7 +451,7 @@ clause_done: if ((ugo[2] || honor_umask) && !rwxXstugo[8]) file_mode = (file_mode & ~(S_IROTH | S_IWOTH | S_IXOTH)) | (new_mode & (S_IROTH | S_IWOTH | S_IXOTH)); -#ifndef __VXWORKS__ +#ifdef S_ISVTX if (is_dir && rwxXstugo[5]) file_mode |= S_ISVTX; else if (!is_dir) @@ -463,7 +463,7 @@ clause_done: { /* Clear '-'. */ file_mode &= ~new_mode; -#if !defined( __MINGW32__) && !defined (__VXWORKS__) +#ifdef S_ISVTX if (rwxXstugo[5] || !is_dir) file_mode &= ~S_ISVTX; #endif @@ -471,7 +471,7 @@ clause_done: else if (set_mode == 3) { file_mode |= new_mode; -#if !defined (__MINGW32__) && !defined (__VXWORKS__) +#ifdef S_ISVTX if (rwxXstugo[5] && is_dir) file_mode |= S_ISVTX; else if (!is_dir) -- 2.4.3