summaryrefslogtreecommitdiff
path: root/libgfortran/intrinsics
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2012-06-06 09:41:09 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2012-06-06 09:41:09 +0000
commita5b5b624bd32ed2a8cdef6c91105a0c58ead9e0a (patch)
treea8ba90785cb82182fb5dd973f850d3ab8a6f2973 /libgfortran/intrinsics
parent825825ba216d22b9b0cc6b4df4cc80e25a4df432 (diff)
downloadgcc-a5b5b624bd32ed2a8cdef6c91105a0c58ead9e0a.tar.gz
2012-06-06 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 188257 using svnmerge git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@188260 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/intrinsics')
-rw-r--r--libgfortran/intrinsics/chmod.c13
-rw-r--r--libgfortran/intrinsics/time_1.h2
2 files changed, 10 insertions, 5 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. */
diff --git a/libgfortran/intrinsics/time_1.h b/libgfortran/intrinsics/time_1.h
index 98a20d2bb70..920b175f79a 100644
--- a/libgfortran/intrinsics/time_1.h
+++ b/libgfortran/intrinsics/time_1.h
@@ -178,7 +178,7 @@ gf_cputime (long *user_sec, long *user_usec, long *system_sec, long *system_usec
struct timespec ts;
int err = clock_gettime (CLOCK_PROCESS_CPUTIME_ID, &ts);
*user_sec = ts.tv_sec;
- *user_usecs = ts.tv_nsec / 1000;
+ *user_usec = ts.tv_nsec / 1000;
*system_sec = *system_usec = 0;
return err;