aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbtk.c
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1996-08-23 07:57:10 +0000
committerFred Fish <fnf@specifix.com>1996-08-23 07:57:10 +0000
commitfe58c81f5caf86ffa0b1df668fd0ec49bcc33bbe (patch)
treed5dc5962c35ccefceccb705eb5cc37418810ebaf /gdb/gdbtk.c
parent3c72ab70359f1c5455a70c7f2989b13e80d0f1e7 (diff)
downloadgdb-fe58c81f5caf86ffa0b1df668fd0ec49bcc33bbe.zip
gdb-fe58c81f5caf86ffa0b1df668fd0ec49bcc33bbe.tar.gz
gdb-fe58c81f5caf86ffa0b1df668fd0ec49bcc33bbe.tar.bz2
* gdbtk.c (gdbtk_init): Check for a DISPLAY env variable and
gracefully degrade to using command line interface if none is found.
Diffstat (limited to 'gdb/gdbtk.c')
-rw-r--r--gdb/gdbtk.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/gdbtk.c b/gdb/gdbtk.c
index 1237ef5..a51f6d9 100644
--- a/gdb/gdbtk.c
+++ b/gdb/gdbtk.c
@@ -1240,6 +1240,13 @@ gdbtk_init ()
struct sigaction action;
static sigset_t nullsigmask = {0};
+ /* If there is no DISPLAY environment variable, Tk_Init below will fail,
+ causing gdb to abort. If instead we simply return here, gdb will
+ gracefully degrade to using the command line interface. */
+
+ if (getenv ("DISPLAY") == NULL)
+ return;
+
old_chain = make_cleanup (cleanup_init, 0);
/* First init tcl and tk. */