diff --git a/0001-gps-plugin-fix-build-with-newer-gpsd.patch b/0001-gps-plugin-fix-build-with-newer-gpsd.patch new file mode 100644 index 0000000..e186783 --- /dev/null +++ b/0001-gps-plugin-fix-build-with-newer-gpsd.patch @@ -0,0 +1,41 @@ +From d5ec9075510601537cc76be4417ab337364506d0 Mon Sep 17 00:00:00 2001 +From: Baruch Siach +Date: Tue, 9 Oct 2018 19:57:21 +0300 +Subject: [PATCH] gps plugin: fix build with newer gpsd + +gpsd version 3.18 changed the prototype of gps_read(). Make the +gps_read() call depend on GPSD_API_MAJOR_VERSION to fix that. + +This fixes build failures like: + +gps.c: In function 'cgps_thread': +gps.c:144:11: error: too few arguments to function 'gps_read' + if (gps_read(&gpsd_conn) == -1) { + ^~~~~~~~ + +(cherry picked from commit 991a6d3fd38c2435d94de3853fda36b3330cf6ab) +--- + src/gps.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/gps.c b/src/gps.c +index 1d32d049..b22c3a2e 100644 +--- a/src/gps.c ++++ b/src/gps.c +@@ -141,7 +141,12 @@ static void *cgps_thread(void *pData) { + continue; + } + +- if (gps_read(&gpsd_conn) == -1) { ++#if GPSD_API_MAJOR_VERSION > 6 ++ if (gps_read(&gpsd_conn, NULL, 0) == -1) ++#else ++ if (gps_read(&gpsd_conn) == -1) ++#endif ++ { + WARNING("gps plugin: incorrect data! (err_count: %d)", err_count); + err_count++; + +-- +2.16.4 + diff --git a/collectd.changes b/collectd.changes index c714716..408faed 100644 --- a/collectd.changes +++ b/collectd.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat Dec 29 14:59:06 UTC 2018 - mardnh@gmx.de + +- Add patch: + * 0001-gps-plugin-fix-build-with-newer-gpsd.patch + ------------------------------------------------------------------- Thu Jun 7 12:24:38 UTC 2018 - mardnh@gmx.de diff --git a/collectd.spec b/collectd.spec index d292fc3..d55e462 100644 --- a/collectd.spec +++ b/collectd.spec @@ -64,6 +64,7 @@ Patch20: collectd-split_README.patch Patch21: collectd-fix_collectd_config_path_in_snmp_probe.patch Patch23: collectd-javac_target.patch Patch24: 9e36cd85a2bb_sigrok_Update_to_support_libsigrok_0_4.patch +Patch25: 0001-gps-plugin-fix-build-with-newer-gpsd.patch # for /etc/apache2/... ownership (rpmlint): BuildRequires: apache2 BuildRequires: autoconf @@ -419,6 +420,7 @@ to write %{name} unixsock clients. %if 0%{?suse_version} > 1320 %patch24 -p1 %endif +%patch25 -p1 sed -i 's|@@VERSION@@|%{version}|g' configure.ac