summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2006-08-14 06:40:01 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2006-08-14 06:40:01 +0000
commitfed00126cfcbb0330a20f4d073034cfe52352a61 (patch)
treed60e4beb6a1c3b1409ae8aa94a448337933019f9 /sci-geosciences/gpsd/files
parentAdded ~ppc (diff)
downloadgentoo-2-fed00126cfcbb0330a20f4d073034cfe52352a61.tar.gz
gentoo-2-fed00126cfcbb0330a20f4d073034cfe52352a61.tar.bz2
gentoo-2-fed00126cfcbb0330a20f4d073034cfe52352a61.zip
Fix bug #132288 and also two other hotplug issues that I personally ran into. The patches have been submitted upstream.
(Portage version: 2.1.1_pre4-r3)
Diffstat (limited to 'sci-geosciences/gpsd/files')
-rw-r--r--sci-geosciences/gpsd/files/digest-gpsd-2.33-r13
-rw-r--r--sci-geosciences/gpsd/files/gpsd-2.33-duplicate-device-add-hang.patch26
-rw-r--r--sci-geosciences/gpsd/files/gpsd-2.33-hotplug-background-fix.patch54
3 files changed, 83 insertions, 0 deletions
diff --git a/sci-geosciences/gpsd/files/digest-gpsd-2.33-r1 b/sci-geosciences/gpsd/files/digest-gpsd-2.33-r1
new file mode 100644
index 000000000000..3ebb820ad471
--- /dev/null
+++ b/sci-geosciences/gpsd/files/digest-gpsd-2.33-r1
@@ -0,0 +1,3 @@
+MD5 03b57754091e4a34e27c78e1dc35c55e gpsd-2.33.tar.gz 639348
+RMD160 175b90cb8dda1d85964078a4f14cec84b0cc4885 gpsd-2.33.tar.gz 639348
+SHA256 e6a055689ad05f6adba7dbb9490891a18a240d1a30e34424b3a034f4152f2c28 gpsd-2.33.tar.gz 639348
diff --git a/sci-geosciences/gpsd/files/gpsd-2.33-duplicate-device-add-hang.patch b/sci-geosciences/gpsd/files/gpsd-2.33-duplicate-device-add-hang.patch
new file mode 100644
index 000000000000..5e3d957a478a
--- /dev/null
+++ b/sci-geosciences/gpsd/files/gpsd-2.33-duplicate-device-add-hang.patch
@@ -0,0 +1,26 @@
+If you try to add the same device twice with the hotplug script, gpsd does not
+send any error back to the script, leading to it waiting forever on recv(), and
+blocking gpsd from progressing in it's select loop.
+
+This patch makes the daemon write back an error to the control socket (in
+addition the the normal debug output), so that the hotplug script does not
+block for the socket, and everything proceeds much better.
+
+Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
+
+diff -Nuar --exclude '*~' gpsd-2.33.orig/gpsd.c gpsd-2.33/gpsd.c
+--- gpsd-2.33.orig/gpsd.c 2006-06-09 05:34:09.000000000 -0700
++++ gpsd-2.33/gpsd.c 2006-08-13 15:42:25.152204904 -0700
+@@ -1048,9 +1048,10 @@
+ (void)write(sfd, "ERROR\n", 6);
+ } else if (buf[0] == '+') {
+ p = snarfline(buf+1, &stash);
+- if (find_device(stash))
++ if (find_device(stash)) {
+ gpsd_report(1,"<= control(%d): %s already active \n", sfd, stash);
+- else {
++ (void)write(sfd, "ERROR\n", 6);
++ } else {
+ gpsd_report(1,"<= control(%d): adding %s \n", sfd, stash);
+ if (open_device(stash))
+ (void)write(sfd, "OK\n", 3);
diff --git a/sci-geosciences/gpsd/files/gpsd-2.33-hotplug-background-fix.patch b/sci-geosciences/gpsd/files/gpsd-2.33-hotplug-background-fix.patch
new file mode 100644
index 000000000000..03963ed6e5b8
--- /dev/null
+++ b/sci-geosciences/gpsd/files/gpsd-2.33-hotplug-background-fix.patch
@@ -0,0 +1,54 @@
+In recent versions of udev, the gpsd script runs in series with the task that
+creates the real /dev/ttyUSB0 device node. Unfortuntely, the gpsd script runs
+BEFORE the creation of the node, and the node is not created until after you
+kill the gpsd script, because the gpsd script waits forever for the node to
+appear.
+
+This is a race condition, and is best fixed by running the actual wait/hotplug
+portion in the background.
+
+Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
+
+diff -Nuar --exclude '*~' gpsd-2.33.orig/gpsd.hotplug gpsd-2.33/gpsd.hotplug
+--- gpsd-2.33.orig/gpsd.hotplug 2005-06-27 11:53:00.000000000 -0700
++++ gpsd-2.33/gpsd.hotplug 2006-08-13 18:35:03.382383884 -0700
+@@ -56,7 +56,7 @@
+ return action
+
+ def hotplug(action, devpath):
+- #syslog.syslog("ACTION=%s" % action)
++ #syslog.syslog("ACTION=%s DEVPATH=%s" % (action,devpath))
+ if not devpath:
+ syslog.syslog("No device")
+ else:
+@@ -88,16 +88,18 @@
+ return
+
+ if __name__ == '__main__':
+- syslog.openlog('gpsd.hotplug', 0, syslog.LOG_DAEMON)
+- try:
+- if len(sys.argv) == 1: # Called as hotplug script
+- hotplug(os.getenv("ACTION"), os.getenv("DEVPATH"))
+- else: # Called by hand for testing
+- gpsd_control(sys.argv[1], sys.argv[2])
+- except:
+- (exc_type, exc_value, exc_traceback) = sys.exc_info()
+- syslog.syslog("gpsd.hotplug: exception %s yields %s" % (exc_type, exc_value))
+- raise exc_type, exc_value, exc_traceback
+- #syslog.syslog("gpsd.hotplug ends")
+- syslog.closelog()
++ pid = os.fork()
++ if not pid:
++ syslog.openlog('gpsd.hotplug', 0, syslog.LOG_DAEMON)
++ try:
++ if len(sys.argv) == 1: # Called as hotplug script
++ hotplug(os.getenv("ACTION"), os.getenv("DEVPATH"))
++ else: # Called by hand for testing
++ gpsd_control(sys.argv[1], sys.argv[2])
++ except:
++ (exc_type, exc_value, exc_traceback) = sys.exc_info()
++ syslog.syslog("gpsd.hotplug: exception %s yields %s" % (exc_type, exc_value))
++ raise exc_type, exc_value, exc_traceback
++ #syslog.syslog("gpsd.hotplug ends")
++ syslog.closelog()
+