diff options
| author | Maxin B. John <maxin.john@enea.com> | 2015-02-16 09:25:02 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-02-16 09:09:43 +0000 |
| commit | b427750a5d8e2a2e1a675f68dea250eb25e94c8e (patch) | |
| tree | 4b7d4214cdf3c9959858c757eee5e85b53433f10 /bitbake/lib/bb/ui/depexp.py | |
| parent | a2bfd4b1fb055e63a48d80e7e55a6cff475e06d1 (diff) | |
| download | poky-b427750a5d8e2a2e1a675f68dea250eb25e94c8e.tar.gz | |
bitbake: depexp.py: Fix segfault if DISPLAY is not set
bitbake -g -u depexp <package> segfaults when DISPLAY is not set
properly. Fix it with a proper check.
[YOCTO #7299]
(Bitbake rev: f35e9bd7b59c180fe9a3d9177efb57b92d9cd373)
Signed-off-by: Maxin B. John <maxin.john@enea.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/depexp.py')
| -rw-r--r-- | bitbake/lib/bb/ui/depexp.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bitbake/lib/bb/ui/depexp.py b/bitbake/lib/bb/ui/depexp.py index 0c71a3ebd2..240aafc3e7 100644 --- a/bitbake/lib/bb/ui/depexp.py +++ b/bitbake/lib/bb/ui/depexp.py | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | # with this program; if not, write to the Free Software Foundation, Inc., | 17 | # with this program; if not, write to the Free Software Foundation, Inc., |
| 18 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | 18 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 19 | 19 | ||
| 20 | import sys | ||
| 20 | import gobject | 21 | import gobject |
| 21 | import gtk | 22 | import gtk |
| 22 | import Queue | 23 | import Queue |
| @@ -215,6 +216,12 @@ def main(server, eventHandler, params): | |||
| 215 | print("XMLRPC Fault getting commandline:\n %s" % x) | 216 | print("XMLRPC Fault getting commandline:\n %s" % x) |
| 216 | return | 217 | return |
| 217 | 218 | ||
| 219 | try: | ||
| 220 | gtk.init_check() | ||
| 221 | except RuntimeError: | ||
| 222 | sys.stderr.write("Please set DISPLAY variable before running this command \n") | ||
| 223 | return | ||
| 224 | |||
| 218 | shutdown = 0 | 225 | shutdown = 0 |
| 219 | 226 | ||
| 220 | gtkgui = gtkthread(shutdown) | 227 | gtkgui = gtkthread(shutdown) |
