openbsd-ports/print/cups/patches/patch-scheduler_log_c
2013-03-19 08:49:14 +00:00

25 lines
980 B
Plaintext

$OpenBSD: patch-scheduler_log_c,v 1.3 2013/03/19 08:49:14 ajacoutot Exp $
log.c:289: warning: passing argument 1 of 'localtime' from incompatible pointer type
--- scheduler/log.c.orig Wed Dec 12 19:03:02 2012
+++ scheduler/log.c Tue Mar 19 08:15:45 2013
@@ -251,6 +251,7 @@ char * /* O - Date/time string */
cupsdGetDateTime(struct timeval *t, /* I - Time value or NULL for current */
cupsd_time_t format) /* I - Format to use */
{
+ time_t tmp;
struct timeval curtime; /* Current time value */
struct tm *date; /* Date/time value */
static struct timeval last_time = { 0, 0 };
@@ -302,7 +303,8 @@ cupsdGetDateTime(struct timeval *t, /* I - Time value
* (*BSD and Darwin store the timezone offset in the tm structure)
*/
- date = localtime(&(t->tv_sec));
+ tmp = t->tv_sec;
+ date = localtime (&tmp);
if (format == CUPSD_TIME_STANDARD)
snprintf(s, sizeof(s), "[%02d/%s/%04d:%02d:%02d:%02d %+03ld%02ld]",