This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][DJGPP][libgfortran] Do not use S_ISVTX for DJGPP in libfortran/intrinsic/chmod.c


On 11/15/2015 09:19 PM, Andreas Schwab wrote:
Andris Pavenis <andris.pavenis@iki.fi> 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 <andris.pavenis@iki.fi>

* libgfortran/intrinsics/chmod.c: use S_ISVTX only when it is defined


>From 6fcff7721ce292df7889797f1380d5313e445c6f Mon Sep 17 00:00:00 2001
From: Andris Pavenis <andris.pavenis@iki.fi>
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 <andris.pavenis@iki.fi>

* 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]