diff options
author | ktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-01-29 17:20:13 +0000 |
---|---|---|
committer | ktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-01-29 17:20:13 +0000 |
commit | f4af8ac8bc485d3c5251ad80df71f4af0e5fe142 (patch) | |
tree | ea0369a7724abfcaa713c74e259dec3b6eebb26e /libgfortran | |
parent | a3654ec22b8338ed6c7c908492c499399c05f531 (diff) | |
download | gcc-f4af8ac8bc485d3c5251ad80df71f4af0e5fe142.tar.gz |
2011-01-29 Kai Tietz <kai.tietz@onevision.com>
* intrinsics/ctime.c (ctime_r): Improve implementation.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@169389 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 4 | ||||
-rw-r--r-- | libgfortran/intrinsics/ctime.c | 8 |
2 files changed, 11 insertions, 1 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 2515ca5e38a..5e0c7623e97 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,7 @@ +2011-01-29 Kai Tietz <kai.tietz@onevision.com> + + * intrinsics/ctime.c (ctime_r): Improve implementation. + 2011-01-27 Janne Blomqvist <jb@gcc.gnu.org> PR libfortran/47431 diff --git a/libgfortran/intrinsics/ctime.c b/libgfortran/intrinsics/ctime.c index 2729616bff0..b7b463c3aca 100644 --- a/libgfortran/intrinsics/ctime.c +++ b/libgfortran/intrinsics/ctime.c @@ -42,11 +42,17 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #ifndef HAVE_CTIME_R +/* Make sure we don't see here a macro. */ +#undef ctime_r + static char * ctime_r (const time_t * timep, char * buf __attribute__((unused))) { #ifdef HAVE_CTIME - return ctime (timep); + char *tmp = ctime (timep); + if (tmp) + tmp = strcpy (buf, tmp); + return tmp; #else return NULL; #endif |