sync with OpenBSD -current

This commit is contained in:
purplerain 2024-04-28 21:30:53 +00:00
parent 6bd4a87a12
commit 6fc9e02a30
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
25 changed files with 193 additions and 130 deletions

View file

@ -271,8 +271,8 @@ log_vmsg(int pri, const char* type,
}
now = (time_t)time(NULL);
#if defined(HAVE_STRFTIME) && defined(HAVE_LOCALTIME_R)
if(log_time_asc && strftime(tmbuf, sizeof(tmbuf), "%b %d %H:%M:%S",
localtime_r(&now, &tm))%(sizeof(tmbuf)) != 0) {
if(log_time_asc && localtime_r(&now, &tm) && strftime(tmbuf,
sizeof(tmbuf), "%b %d %H:%M:%S", &tm)%(sizeof(tmbuf)) != 0) {
/* %sizeof buf!=0 because old strftime returned max on error */
fprintf(logfile, "%s %s[%d:%x] %s: %s\n", tmbuf,
ident, (int)getpid(), tid?*tid:0, type, message);