summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-09 18:30:38 +0000
committerjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-09 18:30:38 +0000
commit78c47e78184a757af74a2bfa8c1dd2615777b9d8 (patch)
treebf063c06847570d9800495f26112ff1ac7d66047 /libgfortran
parenta1aa1d3077cf008c27eb9411fd247f695dbf6bbc (diff)
downloadgcc-78c47e78184a757af74a2bfa8c1dd2615777b9d8.tar.gz
Simplify time() usage.
2011-11-09 Janne Blomqvist <jb@gcc.gnu.org> * intrinsics/time_1.h (gf_gettime): Simplify time() usage. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181228 138bc75d-0d04-0410-961f-82ee72b054a4
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 f299ccba633..f0b64c95093 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 73977cbef61..327f7cf4e0e 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;