mirror of
https://github.com/bol-van/zapret.git
synced 2025-12-31 11:55:55 +03:00
autohostlist debug
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <sys/socket.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <ifaddrs.h>
|
||||
#include <time.h>
|
||||
|
||||
char *strncasestr(const char *s,const char *find, size_t slen)
|
||||
{
|
||||
@@ -211,3 +212,13 @@ int get_so_error(int fd)
|
||||
errn=errno;
|
||||
return errn;
|
||||
}
|
||||
|
||||
int fprint_localtime(FILE *F)
|
||||
{
|
||||
struct tm t;
|
||||
time_t now;
|
||||
|
||||
time(&now);
|
||||
localtime_r(&now,&t);
|
||||
return fprintf(F, "%02d.%02d.%04d %02d:%02d:%02d", t.tm_mday, t.tm_mon + 1, t.tm_year + 1900, t.tm_hour, t.tm_min, t.tm_sec);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user