summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-18 11:43:32 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-18 11:54:28 +0000
commit359a4d8bf72867b4d5f3daaf8c4f14a82a810107 (patch)
tree50ba2f22166be41d8c6ea712b99242f7641bf2c1
parent15751138968ecaca42b247685142e5f495d6eccd (diff)
downloadpoky-359a4d8bf72867b4d5f3daaf8c4f14a82a810107.tar.gz
bitbake/runqueue.py: Move SIGCHLD handler to wrap none server sleep call
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/runqueue.py7
-rw-r--r--bitbake/lib/bb/server/none.py7
2 files changed, 7 insertions, 7 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 7d1f48aee2..8a88fe026d 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -748,9 +748,6 @@ class RunQueueData:
748 self.rqdata.runq_depends[task], 748 self.rqdata.runq_depends[task],
749 self.rqdata.runq_revdeps[task]) 749 self.rqdata.runq_revdeps[task])
750 750
751# Dummy signal handler to ensure we break out of sleep upon SIGCHLD
752def chldhandler(signum, stackframe):
753 pass
754 751
755class RunQueue: 752class RunQueue:
756 def __init__(self, cooker, cfgData, dataCache, taskData, targets): 753 def __init__(self, cooker, cfgData, dataCache, taskData, targets):
@@ -764,8 +761,6 @@ class RunQueue:
764 761
765 self.state = runQueuePrepare 762 self.state = runQueuePrepare
766 763
767 signal.signal(signal.SIGCHLD, chldhandler)
768
769 def check_stamps(self): 764 def check_stamps(self):
770 unchecked = {} 765 unchecked = {}
771 current = [] 766 current = []
@@ -1107,8 +1102,6 @@ class RunQueueExecute:
1107 # themselves 1102 # themselves
1108 bblogger.handlers = [bb.event.LogHandler()] 1103 bblogger.handlers = [bb.event.LogHandler()]
1109 1104
1110 signal.signal(signal.SIGCHLD, signal.SIG_DFL)
1111
1112 self.rq.state = runQueueChildProcess 1105 self.rq.state = runQueueChildProcess
1113 # Make the child the process group leader 1106 # Make the child the process group leader
1114 os.setpgid(0, 0) 1107 os.setpgid(0, 0)
diff --git a/bitbake/lib/bb/server/none.py b/bitbake/lib/bb/server/none.py
index 2708807dfc..be0fb8f776 100644
--- a/bitbake/lib/bb/server/none.py
+++ b/bitbake/lib/bb/server/none.py
@@ -36,6 +36,7 @@ import bb
36from bb.ui import uievent 36from bb.ui import uievent
37import xmlrpclib 37import xmlrpclib
38import pickle 38import pickle
39import signal
39 40
40DEBUG = False 41DEBUG = False
41 42
@@ -105,6 +106,10 @@ class BBUIEventQueue:
105 def system_quit( self ): 106 def system_quit( self ):
106 bb.event.unregister_UIHhandler(self.EventHandle) 107 bb.event.unregister_UIHhandler(self.EventHandle)
107 108
109# Dummy signal handler to ensure we break out of sleep upon SIGCHLD
110def chldhandler(signum, stackframe):
111 pass
112
108class BitBakeServer(): 113class BitBakeServer():
109 # remove this when you're done with debugging 114 # remove this when you're done with debugging
110 # allow_reuse_address = True 115 # allow_reuse_address = True
@@ -144,7 +149,9 @@ class BitBakeServer():
144 pass 149 pass
145 if nextsleep is not None: 150 if nextsleep is not None:
146 #print "Sleeping for %s (%s)" % (nextsleep, delay) 151 #print "Sleeping for %s (%s)" % (nextsleep, delay)
152 signal.signal(signal.SIGCHLD, chldhandler)
147 time.sleep(nextsleep) 153 time.sleep(nextsleep)
154 signal.signal(signal.SIGCHLD, signal.SIG_DFL)
148 155
149 def server_exit(self): 156 def server_exit(self):
150 # Tell idle functions we're exiting 157 # Tell idle functions we're exiting