mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-08-03 17:59:07 -04:00
23 lines
978 B
C
23 lines
978 B
C
$NetBSD: patch-main_logger.c,v 1.1 2015/05/19 07:52:14 jnemeth Exp $
|
|
|
|
--- main/logger.c.orig 2015-03-19 10:19:11.000000000 +0000
|
|
+++ main/logger.c
|
|
@@ -607,7 +607,7 @@ void ast_queue_log(const char *queuename
|
|
|
|
if (qlog) {
|
|
va_start(ap, fmt);
|
|
- qlog_len = snprintf(qlog_msg, sizeof(qlog_msg), "%ld|%s|%s|%s|%s|", (long)time(NULL), callid, queuename, agent, event);
|
|
+ qlog_len = snprintf(qlog_msg, sizeof(qlog_msg), "%jd|%s|%s|%s|%s|", (intmax_t)time(NULL), callid, queuename, agent, event);
|
|
vsnprintf(qlog_msg + qlog_len, sizeof(qlog_msg) - qlog_len, fmt, ap);
|
|
va_end(ap);
|
|
AST_RWLIST_RDLOCK(&logchannels);
|
|
@@ -644,7 +644,7 @@ static int rotate_file(const char *filen
|
|
}
|
|
break;
|
|
case TIMESTAMP:
|
|
- snprintf(new, sizeof(new), "%s.%ld", filename, (long)time(NULL));
|
|
+ snprintf(new, sizeof(new), "%s.%jd", filename, (intmax_t)time(NULL));
|
|
if (rename(filename, new)) {
|
|
fprintf(stderr, "Unable to rename file '%s' to '%s'\n", filename, new);
|
|
res = -1;
|