autohostlist debug

This commit is contained in:
bol-van
2023-11-09 12:08:09 +03:00
parent 2245377671
commit 3559e1f2b8
34 changed files with 194 additions and 64 deletions

View File

@@ -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);
}