File gnupg-2.0.4-default-tty.diff of Package gpg2

# sets default tty to /dev/tty
Index: common/asshelp.c
===================================================================
--- common/asshelp.c.orig	2008-10-20 14:54:58.000000000 +0200
+++ common/asshelp.c	2009-06-18 11:41:47.000000000 +0200
@@ -97,6 +97,8 @@ send_pinentry_environment (assuan_contex
       dft_ttyname = getenv ("GPG_TTY");
       if ((!dft_ttyname || !*dft_ttyname) && ttyname (0))
         dft_ttyname = ttyname (0);
+      if (!dft_ttyname)
+        dft_ttyname = "/dev/tty";
     }
   if (opt_ttyname || dft_ttyname)
     {
Index: common/simple-pwquery.c
===================================================================
--- common/simple-pwquery.c.orig	2009-05-20 09:39:10.000000000 +0200
+++ common/simple-pwquery.c	2009-06-18 11:41:47.000000000 +0200
@@ -225,6 +225,8 @@ agent_send_all_options (int fd)
 #ifndef HAVE_W32_SYSTEM
   if ((!dft_ttyname || !*dft_ttyname) && ttyname (0))
     dft_ttyname = ttyname (0);
+  if (!dft_ttyname)
+    dft_ttyname = "/dev/tty";
 #endif
   if (dft_ttyname && *dft_ttyname)
     {