summaryrefslogtreecommitdiff
path: root/libgfortran/intrinsics/chmod.c
diff options
context:
space:
mode:
authorFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>2016-12-19 13:41:32 +0000
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2016-12-19 13:41:32 +0000
commitdc31c238bd382061196e8e9f4f68057feac4ee9b (patch)
tree660135db4f07e2dcb8c14aadb3c891c9d6343ad2 /libgfortran/intrinsics/chmod.c
parent4b21c3ea03540ba1d89bca16561820f0911e17ce (diff)
downloadgcc-dc31c238bd382061196e8e9f4f68057feac4ee9b.tar.gz
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
Diffstat (limited to 'libgfortran/intrinsics/chmod.c')
-rw-r--r--libgfortran/intrinsics/chmod.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/libgfortran/intrinsics/chmod.c b/libgfortran/intrinsics/chmod.c
index 5aae77b0553..4f4d723daf1 100644
--- a/libgfortran/intrinsics/chmod.c
+++ b/libgfortran/intrinsics/chmod.c
@@ -82,16 +82,10 @@ chmod_internal (char *file, char *mode, gfc_charlen_type mode_len)
if (mode[0] >= '0' && mode[0] <= '9')
{
-#ifdef __MINGW32__
unsigned fmode;
if (sscanf (mode, "%o", &fmode) != 1)
return 1;
- file_mode = (mode_t) fmode;
-#else
- if (sscanf (mode, "%o", &file_mode) != 1)
- return 1;
-#endif
- return chmod (file, file_mode);
+ return chmod (file, (mode_t) fmode);
}
/* Read the current file mode. */