aboutsummaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorJanne Blomqvist <jb@gcc.gnu.org>2011-11-09 20:30:38 +0200
committerJanne Blomqvist <jb@gcc.gnu.org>2011-11-09 20:30:38 +0200
commit9f13f697497c1bc7d3b9609eafad3ffec52d83b8 (patch)
treebf063c06847570d9800495f26112ff1ac7d66047 /libgfortran
parent745443787599147145baf2c0cdfe8ef463944a9c (diff)
downloadgcc-9f13f697497c1bc7d3b9609eafad3ffec52d83b8.zip
gcc-9f13f697497c1bc7d3b9609eafad3ffec52d83b8.tar.gz
gcc-9f13f697497c1bc7d3b9609eafad3ffec52d83b8.tar.bz2
Simplify time() usage.
2011-11-09 Janne Blomqvist <jb@gcc.gnu.org> * intrinsics/time_1.h (gf_gettime): Simplify time() usage. From-SVN: r181228
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog4
-rw-r--r--libgfortran/intrinsics/time_1.h5
2 files changed, 6 insertions, 3 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index f299ccb..f0b64c9 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,5 +1,9 @@
2011-11-09 Janne Blomqvist <jb@gcc.gnu.org>
+ * intrinsics/time_1.h (gf_gettime): Simplify time() usage.
+
+2011-11-09 Janne Blomqvist <jb@gcc.gnu.org>
+
* configure.ac (AC_STDC_HEADERS): Remove.
(AC_HEADER_TIME): Remove.
(AC_HAVE_HEADERS, AC_CHECK_HEADERS): Move into a single invocation
diff --git a/libgfortran/intrinsics/time_1.h b/libgfortran/intrinsics/time_1.h
index 73977cb..327f7cf 100644
--- a/libgfortran/intrinsics/time_1.h
+++ b/libgfortran/intrinsics/time_1.h
@@ -213,9 +213,8 @@ gf_gettime (time_t * secs, long * usecs)
*usecs = tv.tv_usec;
return err;
#else
- time_t t, t2;
- t = time (&t2);
- *secs = t2;
+ time_t t = time (NULL);
+ *secs = t;
*usecs = 0;
if (t == ((time_t)-1))
return -1;