diff options
| author | ghost <andreas.monzner@multimedia-labs.de> | 2011-09-13 10:55:04 +0200 |
|---|---|---|
| committer | ghost <andreas.monzner@multimedia-labs.de> | 2011-09-13 10:55:04 +0200 |
| commit | b9c74c31ba84d9c8a2c561cd69c5132eff74f19f (patch) | |
| tree | 67073bddc086f110007b64405356eef8813745d9 /lib | |
| parent | 804ad88e6679853bd2db717fc542263d48075631 (diff) | |
| parent | 28049a70f8d591d4b6f61ce30c8066e2c00fc6aa (diff) | |
| download | enigma2-b9c74c31ba84d9c8a2c561cd69c5132eff74f19f.tar.gz enigma2-b9c74c31ba84d9c8a2c561cd69c5132eff74f19f.zip | |
Merge remote-tracking branch 'origin/bug_671_python_update'
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/python/Plugins/SystemPlugins/Hotplug/plugin.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py b/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py index 84cbbcb6..e26a93c6 100644 --- a/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py +++ b/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py @@ -50,12 +50,12 @@ IOC_TYPESHIFT = (IOC_NRSHIFT+IOC_NRBITS) BLKRRPART = ((0x12<<IOC_TYPESHIFT) | (95<<IOC_NRSHIFT)) def autostart(reason, **kwargs): + global bdpoll if reason == 0: print "starting hotplug handler" if fileExists('/dev/.udev'): global netlink - global bdpoll from enigma import eSocketNotifier, eTimer, ePythonMessagePump import socket from select import POLLIN, POLLPRI @@ -256,6 +256,8 @@ def autostart(reason, **kwargs): self.__lock.release() netlink = Netlink() + if bdpoll is not None: + bdpoll.running = False bdpoll = BDPoll() for blockdev, removable, is_cdrom, medium_found in harddiskmanager.devices_scanned_on_init: if removable or is_cdrom: @@ -295,6 +297,12 @@ def autostart(reason, **kwargs): factory = Factory() factory.protocol = Hotplug reactor.listenUNIX("/tmp/hotplug.socket", factory) + else: + if bdpoll: + bdpoll.running = False + bdpoll.timeout() # XXX: I assume the timer is shut down before it executes again, so release the semaphore manually + bdpoll.join() + bdpoll = None def Plugins(**kwargs): return PluginDescriptor(name = "Hotplug", description = "listens to hotplug events", where = PluginDescriptor.WHERE_AUTOSTART, needsRestart = True, fnc = autostart) |
