TimePrint: remove unused time_t overload

This commit is contained in:
Max Kellermann 2018-07-25 08:33:59 +02:00
parent 78a65cf281
commit a8ac8b2563
2 changed files with 6 additions and 10 deletions

View File

@ -22,13 +22,15 @@
#include "client/Response.hxx"
void
time_print(Response &r, const char *name, time_t t)
time_print(Response &r, const char *name,
std::chrono::system_clock::time_point t)
{
time_t t2 = std::chrono::system_clock::to_time_t(t);
#ifdef _WIN32
const struct tm *tm2 = gmtime(&t);
const struct tm *tm2 = gmtime(&t2);
#else
struct tm tm;
const struct tm *tm2 = gmtime_r(&t, &tm);
const struct tm *tm2 = gmtime_r(&t2, &tm);
#endif
if (tm2 == nullptr)
return;

View File

@ -30,13 +30,7 @@ class Response;
* Write a line with a time stamp to the client.
*/
void
time_print(Response &r, const char *name, time_t t);
inline void
time_print(Response &r, const char *name,
std::chrono::system_clock::time_point t)
{
time_print(r, name, std::chrono::system_clock::to_time_t(t));
}
std::chrono::system_clock::time_point t);
#endif