diff options
Diffstat (limited to 'contrib/ldns/compat/ctime_r.c')
-rw-r--r-- | contrib/ldns/compat/ctime_r.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/contrib/ldns/compat/ctime_r.c b/contrib/ldns/compat/ctime_r.c new file mode 100644 index 0000000..4ffd8b7 --- /dev/null +++ b/contrib/ldns/compat/ctime_r.c @@ -0,0 +1,16 @@ +#ifdef HAVE_CONFIG_H +#include <ldns/config.h> +#endif + +#ifdef HAVE_TIME_H +#include <time.h> +#endif + +char *ctime_r(const time_t *timep, char *buf) +{ + /* no thread safety. */ + char* result = ctime(timep); + if(buf && result) + strcpy(buf, result); + return result; +} |