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]

[Patch, libgfortran] PR53445/53444 - Fix compilation on VxWorks


The attached patches fix compilation issues on VxWorks.

a) VxWorks has strerror_r but contrary to POSIX, the function in VxWorks (at least in older versions) takes only two arguments: errnum and buf and not also the buffer length. I added a configure check for that variant.

b) There is no sticky bit on VxWorks - which is now ignored via an #ifdef.

The patch of (b) is the bug reporter's and, thus, tested on VxWorks.

(a) and (b) have been successfully bootstrapped on x86-64-linux.

OK for the trunk?

(I have regenerated the files with the latest 1.11 automake (1.11.5). Before the committal, I will re-generate them with 1.11.1.)

Tobias

2012-05-22  Tobias Burnus  <burnus@net-b.de>

	PR libfortran/53445
	* intrinsics/chmod.c (chmod_func): Ignore S_ISVTX on VxWorks.

diff --git a/libgfortran/intrinsics/chmod.c b/libgfortran/intrinsics/chmod.c
index 9156303..e8a81d5 100644
--- a/libgfortran/intrinsics/chmod.c
+++ b/libgfortran/intrinsics/chmod.c
@@ -459,17 +459,19 @@ 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 (is_dir && rwxXstugo[5])
 	  file_mode |= S_ISVTX;
 	else if (!is_dir)
 	  file_mode &= ~S_ISVTX;
 #endif
+#endif
       }
     else if (set_mode == 2)
       {
 	/* Clear '-'.  */
 	file_mode &= ~new_mode;
-#ifndef __MINGW32__
+#if !defined( __MINGW32__) && !defined (__VXWORKS__)
 	if (rwxXstugo[5] || !is_dir)
 	  file_mode &= ~S_ISVTX;
 #endif
@@ -477,7 +479,7 @@ clause_done:
     else if (set_mode == 3)
       {
 	file_mode |= new_mode;
-#ifndef __MINGW32__
+#if !defined (__MINGW32__) && !defined (__VXWORKS__)
 	if (rwxXstugo[5] && is_dir)
 	  file_mode |= S_ISVTX;
 	else if (!is_dir)

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