]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
Add the pid to the event messages so we can identify which worker events come from...
authorRichard Purdie <rpurdie@linux.intel.com>
Sat, 6 Dec 2008 12:00:15 +0000 (12:00 +0000)
committerRichard Purdie <rpurdie@linux.intel.com>
Sat, 6 Dec 2008 12:00:15 +0000 (12:00 +0000)
lib/bb/event.py
lib/bb/runqueue.py

index c13a0127a5ab0c48b1ee87f2f70a367268492521..9cf2ee9d70845219a54d4bc48e20a6cca0301439 100644 (file)
@@ -25,12 +25,17 @@ BitBake build tools.
 import os, re
 import bb.utils
 
+# This is the pid for which we should generate the event. This is set when
+# the runqueue forks off.
+worker_pid = 0
+
 class Event:
     """Base class for events"""
     type = "Event"
 
     def __init__(self, d):
         self._data = d
+        self.pid = worker_pid
 
     def getData(self):
         return self._data
index 609514d308d4c38a5e764bd0f6223d7f2519ce4e..dfa9e2a698f92659b1578d509bb667a3abf6b4d4 100644 (file)
@@ -980,6 +980,10 @@ class RunQueue:
                 except OSError, e: 
                     bb.msg.fatal(bb.msg.domain.RunQueue, "fork failed: %d (%s)" % (e.errno, e.strerror))
                 if pid == 0:
+                    # Save out the PID so that the event can include it the
+                    # events
+                    bb.event.worker_pid = os.getpid()
+
                     self.state = runQueueChildProcess
                     # Make the child the process group leader
                     os.setpgid(0, 0)