From a8ce53cdba68bb6092e5b92ce5ccfe718617bd26 Mon Sep 17 00:00:00 2001 From: burnus Date: Fri, 1 Jun 2012 05:53:31 +0000 Subject: 2012-06-01 Tobias Burnus * intrinsics/chmod.c (chmod_func): On MinGW, don't set is_dir * and fix octal-mode handling. * io/unit.c (get_internal_unit): Add cast. * io/unix.c (min): Undef "min" before defining it. * runtime/backtrace.c (show_backtrace): Move label into ifndef __MINGW__ block. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@188098 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgfortran/intrinsics/chmod.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'libgfortran/intrinsics/chmod.c') diff --git a/libgfortran/intrinsics/chmod.c b/libgfortran/intrinsics/chmod.c index e8a81d54ba2..43b8de2e279 100644 --- a/libgfortran/intrinsics/chmod.c +++ b/libgfortran/intrinsics/chmod.c @@ -74,7 +74,10 @@ chmod_func (char *name, char *mode, gfc_charlen_type name_len, bool ugo[3]; bool rwxXstugo[9]; int set_mode, part; - bool is_dir, honor_umask, continue_clause = false; + bool honor_umask, continue_clause = false; +#ifndef __MINGW32__ + bool is_dir; +#endif mode_t mode_mask, file_mode, new_mode; struct stat stat_buf; @@ -93,10 +96,10 @@ chmod_func (char *name, char *mode, gfc_charlen_type name_len, if (mode[0] >= '0' && mode[0] <= '9') { #ifdef __MINGW32__ - unsigned mode; - if (sscanf (mode, "%o", &mode) != 1) + unsigned fmode; + if (sscanf (mode, "%o", &fmode) != 1) return 1; - file_mode = (mode_t) mode; + file_mode = (mode_t) fmode; #else if (sscanf (mode, "%o", &file_mode) != 1) return 1; @@ -109,7 +112,9 @@ chmod_func (char *name, char *mode, gfc_charlen_type name_len, return 1; file_mode = stat_buf.st_mode & ~S_IFMT; +#ifndef __MINGW32__ is_dir = stat_buf.st_mode & S_IFDIR; +#endif #ifdef HAVE_UMASK /* Obtain the umask without distroying the setting. */ -- cgit v1.2.1