From 26d74189eb2023ce14af8dd41b36cd388ab8bebb Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 15 Jul 2014 08:28:42 +0200 Subject: [PATCH] gpsd: Do not mess with the argv of the process Henning got really confused that the "a.b.c:1234" he passed to gps2udp showed up as "a.b.c 1234" in the kernel cmdline. Use strdup to take a copy of it. Fixes: SYS#424 --- .../gpsd/gpsd-3.10/leave-argv-untouched.patch | 31 +++++++++++++++++++ recipes-extra/gpsd/gpsd_3.10.bb | 3 +- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 recipes-extra/gpsd/gpsd-3.10/leave-argv-untouched.patch diff --git a/recipes-extra/gpsd/gpsd-3.10/leave-argv-untouched.patch b/recipes-extra/gpsd/gpsd-3.10/leave-argv-untouched.patch new file mode 100644 index 0000000..361bc0c --- /dev/null +++ b/recipes-extra/gpsd/gpsd-3.10/leave-argv-untouched.patch @@ -0,0 +1,31 @@ +Index: gpsd-3.10/gps2udp.c +=================================================================== +--- gpsd-3.10.orig/gps2udp.c ++++ gpsd-3.10/gps2udp.c +@@ -353,6 +353,7 @@ int main(int argc, char **argv) + bool daemonize = false; + long count = -1; + int option; ++ int i; + char *udphostport[MAX_UDP_DEST]; + + flags = WATCH_ENABLE; +@@ -387,7 +388,7 @@ int main(int argc, char **argv) + "gps2udp: too many UDP destinations (max=%d)\n", + MAX_UDP_DEST); + } else { +- udphostport[udpchannel++] = optarg; ++ udphostport[udpchannel++] = strdup(optarg); + } + break; + case 'v': +@@ -490,6 +491,9 @@ int main(int argc, char **argv) + } // end count + } // end len > 3 + } // end for (;;) ++ ++ for (i = 0; i < udpchannel; ++i) ++ free(udphostport[i]); + + // This is an infinite loop, should never be here + /*@-unreachable@*/ diff --git a/recipes-extra/gpsd/gpsd_3.10.bb b/recipes-extra/gpsd/gpsd_3.10.bb index a3856dc..49b85e2 100644 --- a/recipes-extra/gpsd/gpsd_3.10.bb +++ b/recipes-extra/gpsd/gpsd_3.10.bb @@ -6,13 +6,14 @@ DEPENDS = "ncurses python" #DEPENDS = "ncurses libusb1 python" PROVIDES = "virtual/gpsd" -PR = "r3.11" +PR = "r3.12" SRC_URI = "http://download.savannah.gnu.org/releases/${PN}/${P}.tar.gz \ file://0002-SConstruct-respect-sysroot-also-in-SPLINTOPTS.patch \ file://0001-SConstruct-disable-html-and-man-docs-building-becaus.patch \ file://no-rpath-please.patch \ file://gpsd-tsip-pps.patch \ + file://leave-argv-untouched.patch \ file://gpsd-default \ file://gpsd \ file://60-gpsd.rules \