If we fail to initialize gtk, fallback to the curses frontend.
authorNeal H. Walfield <neal@gnu.org>
Tue, 16 Jun 2015 10:52:46 +0000 (12:52 +0200)
committerNeal H. Walfield <neal@gnu.org>
Tue, 16 Jun 2015 10:52:46 +0000 (12:52 +0200)
* gnome3/pinentry-gnome3.c (main): Use gtk_init_check instead of
gtk_init.  If it fails, fallback to the curses frontend.

gnome3/pinentry-gnome3.c

index 2799904..8f91cb8 100644 (file)
@@ -262,7 +262,10 @@ main (int argc, char *argv[])
 
 #ifdef FALLBACK_CURSES
   if (pinentry_have_display (argc, argv))
-    gtk_init (&argc, &argv);
+    {
+      if (! gtk_init_check (&argc, &argv))
+       pinentry_cmd_handler = curses_cmd_handler;
+    }
   else
     pinentry_cmd_handler = curses_cmd_handler;
 #else