diff options
author | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-06-01 05:53:31 +0000 |
---|---|---|
committer | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-06-01 05:53:31 +0000 |
commit | a8ce53cdba68bb6092e5b92ce5ccfe718617bd26 (patch) | |
tree | 63fe8083057cc04125b9f153960462ad7b09fd6b /libgfortran/intrinsics | |
parent | 241098f1407329f1349e7453b31db408cc4d0d93 (diff) | |
download | gcc-a8ce53cdba68bb6092e5b92ce5ccfe718617bd26.tar.gz |
2012-06-01 Tobias Burnus <burnus@net-b.de>
* 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
Diffstat (limited to 'libgfortran/intrinsics')
-rw-r--r-- | libgfortran/intrinsics/chmod.c | 13 |
1 files changed, 9 insertions, 4 deletions
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. */ |