diff options
Diffstat (limited to 'bitbake/lib/bb/daemonize.py')
-rw-r--r-- | bitbake/lib/bb/daemonize.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/bitbake/lib/bb/daemonize.py b/bitbake/lib/bb/daemonize.py index 8380828a17..a4664ad76b 100644 --- a/bitbake/lib/bb/daemonize.py +++ b/bitbake/lib/bb/daemonize.py | |||
@@ -30,6 +30,7 @@ __version__ = "0.2" | |||
30 | import os # Miscellaneous OS interfaces. | 30 | import os # Miscellaneous OS interfaces. |
31 | import sys # System-specific parameters and functions. | 31 | import sys # System-specific parameters and functions. |
32 | import io | 32 | import io |
33 | import traceback | ||
33 | 34 | ||
34 | # Default daemon parameters. | 35 | # Default daemon parameters. |
35 | # File mode creation mask of the daemon. | 36 | # File mode creation mask of the daemon. |
@@ -192,6 +193,10 @@ def createDaemon(function, logfile): | |||
192 | sys.stdout = open(logfile, 'a+') | 193 | sys.stdout = open(logfile, 'a+') |
193 | sys.stderr = sys.stdout | 194 | sys.stderr = sys.stdout |
194 | 195 | ||
195 | function() | 196 | try: |
196 | 197 | function() | |
197 | os._exit(0) | 198 | except Exception as e: |
199 | traceback.print_exc() | ||
200 | bb.event.print_ui_queue() | ||
201 | finally: | ||
202 | os._exit(0) | ||