Commit dc31c238 by Francois-Xavier Coudert Committed by François-Xavier Coudert

chmod.c (chmod_internal): Fix case where mode_t is different from unsigned int.

	* intrinsics/chmod.c (chmod_internal): Fix case where mode_t is
	different from unsigned int.

From-SVN: r243796
parent 4b21c3ea
2016-12-19 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
* intrinsics/chmod.c (chmod_internal): Fix case where mode_t is
different from unsigned int.
2016-12-18 Dominique d'Humieres <dominiq@lps.ens.fr> 2016-12-18 Dominique d'Humieres <dominiq@lps.ens.fr>
PR fortran/78545 PR fortran/78545
......
...@@ -82,16 +82,10 @@ chmod_internal (char *file, char *mode, gfc_charlen_type mode_len) ...@@ -82,16 +82,10 @@ chmod_internal (char *file, char *mode, gfc_charlen_type mode_len)
if (mode[0] >= '0' && mode[0] <= '9') if (mode[0] >= '0' && mode[0] <= '9')
{ {
#ifdef __MINGW32__
unsigned fmode; unsigned fmode;
if (sscanf (mode, "%o", &fmode) != 1) if (sscanf (mode, "%o", &fmode) != 1)
return 1; return 1;
file_mode = (mode_t) fmode; return chmod (file, (mode_t) fmode);
#else
if (sscanf (mode, "%o", &file_mode) != 1)
return 1;
#endif
return chmod (file, file_mode);
} }
/* Read the current file mode. */ /* Read the current file mode. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment