mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
Do not use a broken ttyname.
* configure.ac (HAVE_BROKEN_TTYNAME): New ac_define set for Android systems. * common/util.h (gnupg_ttyname): New macro. Change all callers of ttyname to use this macro instead. (ttyname) [W32]: Rename to _gnupg_ttyname and use also if HAVE_BROKEN_TTYNAME is defined. * common/simple-pwquery.c (agent_send_all_options): Keep on using ttyname unless HAVE_BROKEN_TTYNAME is set. This is because this file may be used standalone.
This commit is contained in:
parent
e7bc5012c5
commit
835698b72b
6 changed files with 24 additions and 9 deletions
|
@ -338,8 +338,11 @@ session_env_getenv_or_default (session_env_t se, const char *name,
|
|||
|
||||
/* Get the default value with an additional fallback for GPG_TTY. */
|
||||
defvalue = getenv (name);
|
||||
if ((!defvalue || !*defvalue) && !strcmp (name, "GPG_TTY") && ttyname (0))
|
||||
defvalue = ttyname (0);
|
||||
if ((!defvalue || !*defvalue) && !strcmp (name, "GPG_TTY")
|
||||
&& gnupg_ttyname (0))
|
||||
{
|
||||
defvalue = gnupg_ttyname (0);
|
||||
}
|
||||
if (defvalue)
|
||||
{
|
||||
/* Record the default value for later use so that we are safe
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue