summaryrefslogtreecommitdiff
path: root/navit/navit.c
diff options
context:
space:
mode:
authorSebastian Leske <sebastian.leske@sleske.name>2016-01-08 08:35:03 +0100
committerSebastian Leske <sebastian.leske@sleske.name>2016-01-11 23:27:38 +0100
commit59f741f634cab4529867e4296276337f03fa8b87 (patch)
tree394aa364800a033a9bf677635e8f35c315391c79 /navit/navit.c
parent12d8bcaf432644b9a926f531f47006fb570f9309 (diff)
downloadnavit-59f741f634cab4529867e4296276337f03fa8b87.tar.gz
Fix:core:Exit if GUI or graphics init / connection fails.R6534
If the initialization of GUI or graphics plugin or connecting the two fails, exit immediately. In that state we cannot reliably continue running, plus there's probably no point anyway.
Diffstat (limited to 'navit/navit.c')
-rw-r--r--navit/navit.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/navit/navit.c b/navit/navit.c
index b130ed967..27426fe17 100644
--- a/navit/navit.c
+++ b/navit/navit.c
@@ -2041,22 +2041,22 @@ navit_init(struct navit *this_)
dbg(lvl_info,"enter gui %p graphics %p\n",this_->gui,this_->gra);
if (!this_->gui && !(this_->flags & 2)) {
- dbg(lvl_error,"Warning: No GUI available.\n");
- return;
+ dbg(lvl_error,"FATAL: No GUI available.\n");
+ exit(1);
}
if (!this_->gra && !(this_->flags & 1)) {
- dbg(lvl_error,"Warning: No graphics subsystem available.\n");
- return;
+ dbg(lvl_error,"FATAL: No graphics subsystem available.\n");
+ exit(1);
}
dbg(lvl_info,"Connecting gui to graphics\n");
if (this_->gui && this_->gra && gui_set_graphics(this_->gui, this_->gra)) {
struct attr attr_type_gui, attr_type_graphics;
gui_get_attr(this_->gui, attr_type, &attr_type_gui, NULL);
graphics_get_attr(this_->gra, attr_type, &attr_type_graphics, NULL);
- dbg(lvl_error,"failed to connect graphics '%s' to gui '%s'\n", attr_type_graphics.u.str, attr_type_gui.u.str);
- dbg(lvl_error," Please see http://wiki.navit-project.org/index.php/Failed_to_connect_graphics_to_gui\n");
- dbg(lvl_error," for explanations and solutions\n");
- return;
+ dbg(lvl_error,"FATAL: Failed to connect graphics '%s' to gui '%s'\n", attr_type_graphics.u.str, attr_type_gui.u.str);
+ dbg(lvl_error,"Please see http://wiki.navit-project.org/index.php/Failed_to_connect_graphics_to_gui "
+ "for explanations and solutions\n");
+ exit(1);
}
if (this_->speech && this_->navigation) {
struct attr speech;