diff mbox

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

Message ID 5648CB8A.9050407@iki.fi
State New
Headers show

Commit Message

Andris Pavēnis Nov. 15, 2015, 6:14 p.m. UTC
DJGPP do not have S_ISVTX defined. Therefore its use should be avoided.
Attached patch updates existing preprocessor conditional constructions
not to use S_ISVTX also for DJGPP

Andris

2015-11-15 Andris Pavenis <andris.pavenis@iki.fi>

* libgfortran/intrinsics/chmod.c (chmod_internal): do not use S_ISVTX for DJGPP target

Comments

Andreas Schwab Nov. 15, 2015, 7:19 p.m. UTC | #1
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.
diff mbox

Patch

From 09606704601c67d87ab69c0ee1da140b8f2d984d Mon Sep 17 00:00:00 2001
From: Andris Pavenis <andris.pavenis@iki.fi>
Date: Sat, 14 Nov 2015 19:37:36 +0200
Subject: [PATCH] [DJGPP] libgfortran/intrinsic/chmod.c: avoid using S_ISVTX
 for DJGPP

---
 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..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__)
 	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__)
+#if !defined( __MINGW32__) && !defined (__VXWORKS__) && !defined(__DJGPP__)
 	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__)
+#if !defined (__MINGW32__) && !defined (__VXWORKS__) && !defined(__DJGPP__)
 	if (rwxXstugo[5] && is_dir)
 	  file_mode |= S_ISVTX;
 	else if (!is_dir)
-- 
2.4.3