kumquat-buildroot/package/gpsd/0001-gpsctl-fix-yodaification.patch
Yann E. MORIN 05595cbeac package/gpsd: bump to 3.24
In 3.24, the NTRIP and NMEA0183 drivers are now always enabled, so the
configure options ntrip and nmea0183 have been removed (upstream commits
f8cf4c922 and 838220fee respectively).

As a consequence, drop the options in menuconfig. We do not need to add
legacy support for those options. Indeed, users who had those enabled
will still get the feature, and those who did not will get them, in both
cases without loss of feature.

Finally, we need to fix a runtime issue that makes the kernel segfault
(yeah, that much), because upstream has been yoda-ifying their code, and
they actually borked a comparison. The issue has been fixed upstream,
but that is in a patch tha cobbles up many changes and brings new stuff,
so we just fix the issue with an unupstreamable patch (which we can drop
when we bump when upstream tags a newer release and we update).

Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
Cc: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-09-17 11:56:25 +02:00

45 lines
1.5 KiB
Diff

From 72ae7ce646792b07061cbbb31ed47f55a1d2422c Mon Sep 17 00:00:00 2001
Message-Id: <72ae7ce646792b07061cbbb31ed47f55a1d2422c.1663075350.git.yann.morin@orange.com>
From: "Yann E. MORIN" <yann.morin@orange.com>
Date: Tue, 13 Sep 2022 15:10:48 +0200
Subject: [PATCH] gpsctl: fix yodaification
Commit d5a672abd98a (gpsctl.c: Style tweaks. Yoda style, braces, //
comments.) claimed "No functional changes", but mis-treated a comparison
when it was converted to yoda-style (simplified diff):
- if (write(gpsdata->gps_fd, buf, strlen(buf)) <= 0) {
+ if (0 <= write(gpsdata->gps_fd, buf, strlen(buf))) {
As one may notice, the comparison operator was not reversed while the
operands were.
This got silently fixed in commit 3219ab9f6a89 (gpsctl.c: First cut at
--ship sending commands to running gpsd.) but this is completely
unrelated.
Fix that comparison.
Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
Upstream status: not applicable as already fixed.
---
gpsctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gpsctl.c b/gpsctl.c
index cb342af87..ef59a6622 100644
--- a/gpsctl.c
+++ b/gpsctl.c
@@ -96,7 +96,7 @@ static bool gps_query(struct gps_data_t *gpsdata,
if ('\n' != buf[strnlen(buf, sizeof(buf) - 1) - 1]) {
(void)strlcat(buf, "\n", sizeof(buf));
}
- if (0 <= write(gpsdata->gps_fd, buf, strnlen(buf, sizeof(buf)))) {
+ if (0 >= write(gpsdata->gps_fd, buf, strnlen(buf, sizeof(buf)))) {
GPSD_LOG(LOG_ERROR, &context.errout, "gps_query(), write failed\n");
return false;
}
--
2.25.1