[syslog-ng]Error compiling 1.6.4 on OpenBSD 3.5-stable

Balazs Scheidler syslog-ng@lists.balabit.hu
Wed, 19 May 2004 16:25:59 +0200


2004-05-19, sze keltezéssel 03:54-kor Steven J. Surdock ezt írta:
> $ ./configure
> ...
> $ make
> ...
> gcc -DHAVE_CONFIG_H -I. -I/home/ssurdock/syslog-ng-1.6.4/src -I.     -g -O2
> -Wall -I/usr/local/include/libol -D_GNU_SOURCE -c macros.c
> macros.c: In function `format_tzofs':
> macros.c:118: error: `tm' undeclared (first use in this function)
> macros.c:118: error: (Each undeclared identifier is reported only once
> macros.c:118: error: for each function it appears in.)
> *** Error code 1

thanks for the report, this patch should be the real solution:

diff -u -r1.4.4.4 macros.c
--- macros.c    6 May 2004 07:37:10 -0000       1.4.4.4
+++ macros.c    19 May 2004 14:24:37 -0000
@@ -105,7 +105,7 @@
 }
  
 static size_t
-format_tzofs(char *dest, size_t left)
+format_tzofs(char *dest, size_t left, struct tm *tm)
 {
        size_t length;
  
@@ -336,7 +336,7 @@
                case M_ISODATE_RECVD:
                case M_ISODATE_STAMP:
                        length = strftime(*dest, *left - 1, "%Y-%m-%dT%H:%M:%S", tm);
-                       length = length + format_tzofs((*dest) + length, *left - length - 1);
+                       length = length + format_tzofs((*dest) + length, *left - length - 1, tm);
                        break;
                case M_FULLDATE:
                case M_FULLDATE_RECVD:
@@ -351,7 +351,7 @@
                case M_TZOFFSET:
                case M_TZOFFSET_RECVD:
                case M_TZOFFSET_STAMP:
-                       length = format_tzofs(*dest, *left - 1);
+                       length = format_tzofs(*dest, *left - 1, tm);
                        break;
                case M_TZ:
                case M_TZ_RECVD:

-- 
Bazsi
PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1